-
Notifications
You must be signed in to change notification settings - Fork 29.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable language extensions to call emmet completion provider #29114
Comments
But If TM scope inspector can figure it out there should be a way to find the current lang. https://github.com/octref/vetur/blob/master/package.json#L81-L95 |
So I guess you don't need to parse the whole document for providing emmet. |
@octref that's the catch. Scope info is not available to extensions. The new emmet is an extension. Another way to go about this is to pass the responsibility of figuring out the right language to the language specific extension. A simple version of the emmet completion provider can be pulled out into a module of its own. This version need not have any parsing or validation for position. That would be done by the language extension. If the user has mapped the language using Thoughts? |
Yep if you can have that I can incorporate it into Vetur.
Sure. Think this approach could possibly allow emmet completions for JSX too for Vue/React. |
@octref I have moved the completion provider for emmet to a separate module https://www.npmjs.com/package/vscode-emmet-helper Can you give it a try and see if you can use it in vetur? Usage is just 2 lines: https://github.com/Microsoft/vscode/blob/07c5fe39ddad3dee42150afa8459954dfbca9538/extensions/emmet/src/defaultCompletionProvider.ts#L31-L32 All you have to do is to pass the right language |
Will give it a try tonight :-) |
@ramya-rao-a Was looking at this and suddenly https://github.com/Microsoft/vscode-emmet-helper went 404. |
@octref That's coz you are looking at the wrong repo :) Look at https://github.com/ramya-rao-a/vscode-emmet-helper or https://www.npmjs.com/package/vscode-emmet-helper |
@octref Also see #29532 (comment) If So check for that before providing completions from vetoer
|
Closing this issue as the work from vscode's side is done. Using the module from vetur is being tracked in vuejs/vetur#232 |
@ramya-rao-a I see because npm package was pointing to Microsoft/vscode-emmet-helper. But currently emmet doesn't seem to be working correctly in Insider, for either html or vue Is it because the new build is not out yet? Mine is 9541932 |
@octref That happens when you have a word stop (like * or :). The suggestions get filtered out. There was a change that went in yesterday in the filtering logic of suggest widget which caused this. See #29758. I am working on it You can still hit Ctrl+Space and you will see the same suggestions as before. |
See vuejs/vetur#232 (comment)
In html files, we use the html parser to figure out the cursor is inside the style tag and then use css instead of html abbr
In non html files that need html like abbreviations, the parsing is not available out of the box and so the emmet extension doesn't realize to use css instead html abbr inside the html tag
Update:
See #29114 (comment) for a proposal that could solve this issue by passing the responsibility of figuring out scope to language specific extensions
The text was updated successfully, but these errors were encountered: