You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Enable language extensions to call emmet completion provider #29114
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
So I guess you don't need to parse the whole document for providing emmet.
Imagine a php file where people'd ask for emmet for the html part...Can't parse PHP too, right 😅
Pine (@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 emmet.syntaxProfiles then the language extension would do nothing special. May be show a notification saying that Hey, you dont need emmet.syntaxProfiles for this language anymore If there is no mapping, then the language extension can call the simple emmet completion provider, pass the right syntax (html/css) and get completions.
A simple version of the emmet completion provider can be pulled out into a module of its own.
Yep if you can have that I can incorporate it into Vetur.
If the user has mapped the language using emmet.syntaxProfiles then the language extension would do nothing special. May be show a notification saying that Hey, you dont need emmet.syntaxProfiles for this language anymore If there is no mapping, then the language extension can call the simple emmet completion provider, pass the right syntax (html/css) and get completions.
Sure.
Think this approach could possibly allow emmet completions for JSX too for Vue/React.
changed the title [-]Css abbr don't work inside style tag in non html files when using emmet.syntaxProfiles[/-][+]New emmet cannot resolve embedded languages[/+]on Jun 21, 2017
Ifemmet.showExpandedAbbreviation is set to always and the user has the mapping "vue-html": "html" in emmet.includeLanguages, then the emmet extension itself will provide the emmet suggestions.
So check for that before providing completions from vetoer
emmet.includeLanguages is the replacement for emmet.syntaxProfiles.
See #29678 (comment)
Pine (@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.
Activity
octref commentedon Jun 20, 2017
But
langis available.If TM scope inspector can figure it out there should be a way to find the current lang.
Previously
syntaxProfilesworked with embedded lang like so:https://github.com/octref/vetur/blob/master/package.json#L81-L95
octref commentedon Jun 20, 2017
So I guess you don't need to parse the whole document for providing emmet.
Imagine a php file where people'd ask for emmet for the html part...Can't parse PHP too, right 😅
ramya-rao-a commentedon Jun 20, 2017
Pine (@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
emmet.syntaxProfilesthen the language extension would do nothing special. May be show a notification saying thatHey, you dont need emmet.syntaxProfiles for this language anymoreIf there is no mapping, then the language extension can call the simple emmet completion provider, pass the right syntax (html/css) and get completions.Thoughts?
octref commentedon Jun 21, 2017
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.
ramya-rao-a commentedon Jun 21, 2017
Pine (@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
[-]Css abbr don't work inside style tag in non html files when using emmet.syntaxProfiles[/-][+]New emmet cannot resolve embedded languages[/+][-]New emmet cannot resolve embedded languages[/-][+]Enable language extensions to call emmet completion provider[/+]octref commentedon Jun 22, 2017
Will give it a try tonight :-)
octref commentedon Jun 28, 2017
Ramya Rao (@ramya-rao-a) Was looking at this and suddenly https://github.com/Microsoft/vscode-emmet-helper went 404.
ramya-rao-a commentedon Jun 28, 2017
Pine (@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
ramya-rao-a commentedon Jun 28, 2017
Pine (@octref) Also see #29532 (comment)
If
emmet.showExpandedAbbreviationis set toalwaysand the user has the mapping"vue-html": "html"inemmet.includeLanguages, then the emmet extension itself will provide the emmet suggestions.So check for that before providing completions from vetoer
emmet.includeLanguagesis the replacement foremmet.syntaxProfiles.See #29678 (comment)
ramya-rao-a commentedon Jun 29, 2017
Closing this issue as the work from vscode's side is done.
Using the module from vetur is being tracked in vuejs/vetur#232
octref commentedon Jun 29, 2017
Ramya Rao (@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
2017-06-29T05:03:32.047Z
ramya-rao-a commentedon Jun 29, 2017
Pine (@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.