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
Emmet 2.0: every word is being expanded by emmet #30265
This seems similar to what I'm having over here.. does your emmet basically suggest any word, whether it's an emmet snippet or not to be used as a tag? It would seem more useful if it only showed an emmet suggestions when it corresponded with an existing emmet snippet. It's pretty annoying inserting a break into a paragraph, only to have the last word turned into a set of tags.
Agreed that this and #30277 even more is annoying. I initially let this be as people also wanted the case of div expanding to <div></div>. Here div is not an emmet snippet. But the expectation is to get it expanded to <div></div>
Here is my proposal:
Do not show emmet expansion in the suggestion list when the typed text is not a snippet (like img) or an abbreviation (like ul>li*3)
If Emmet: Expand Abbreviation is explicitly used, then expand whatever was typed regardless of whether it was a snippet/abbreviation or not.
This way, we do not forcefully push the option of expanding anyrandomthing to <anyrandomthing></anyrandomthing> via suggestion list where it might get expanded when hitting tab. But if the user explicitly runs the Emmet: Expand Abbreviation command, then we trust the judgement of the user and expand without any checks.
So basically, if the word we typed is an emmet abbreviaton, it will be shown on the suggestion llist, for example: p = <p></p> or ul>li*3 = <ul> <li>x3 </ul>
If it is not an emmet abbreviation, it will only be shown if Emmet: Expand Abbreviation is explicitly used?
So we will no longer be getting results such as randomword>tab = <randomword></randomword>
This would be a perfect solution, as the current implementation either has me choosing between not having any emmet suggestions at all, or having everything I type be turned into a suggestion.
Correct. Except p will not be expanded to <p></p> in the suggestion list
I took the example of img because it is a snippet that expands to <img src="" alt="">
This is actually a perfect solution, because in combination with the HTML5 Snippets plugin, you can get both the normal snippets like div, p, h1 as well as the emmet abbreviations. Will we be able to set the emmet abbreviations to take priority when there is a matching snippet?
I'm going to append to this thread because it looks like the same issues around emmet, recently, emmet lorem, generates a "div" tag around it, this is annoying.
Also on ever "enter" the last word is expanded into a tag, which is not what is really intended, the Tab should be enough (if that is configurable, then the default changed, how can I configure back?)
That's different. lorem is a valid abbreviation and emmet should have returned without the div. emmetio/atom-plugin#28 is logged as an upstream issue for that.
Also on ever "enter" the last word is expanded into a tag,
Am back from vacation and conferences, now to some bug fixes :)
Steve Lombardi (@smlombardi)niichie I have pushed a fix to skip emmet suggestions when text is not a known snippet or a form of abbreviation. Emmet: Expand Abbreviation command is not affected by this change.
The change will be out in Wednesday's Insiders (19th July)
Activity
niichie commentedon Jul 9, 2017
This seems similar to what I'm having over here.. does your emmet basically suggest any word, whether it's an emmet snippet or not to be used as a tag? It would seem more useful if it only showed an emmet suggestions when it corresponded with an existing emmet snippet. It's pretty annoying inserting a break into a paragraph, only to have the last word turned into a set of tags.
#30277
smlombardi commentedon Jul 9, 2017
niichie I agree, it shouldn't "suggest" completions that aren't real tags.
ramya-rao-a commentedon Jul 9, 2017
Agreed that this and #30277 even more is annoying. I initially let this be as people also wanted the case of
divexpanding to<div></div>. Heredivis not an emmet snippet. But the expectation is to get it expanded to<div></div>Here is my proposal:
img) or an abbreviation (likeul>li*3)Emmet: Expand Abbreviationis explicitly used, then expand whatever was typed regardless of whether it was a snippet/abbreviation or not.This way, we do not forcefully push the option of expanding
anyrandomthingto<anyrandomthing></anyrandomthing>via suggestion list where it might get expanded when hitting tab. But if the user explicitly runs theEmmet: Expand Abbreviationcommand, then we trust the judgement of the user and expand without any checks.[-]Emmet 2.0: tag suggested as completion inside a tag[/-][+]Emmet 2.0: every word is being expanded by emmet[/+]niichie commentedon Jul 9, 2017
So basically, if the word we typed is an emmet abbreviaton, it will be shown on the suggestion llist, for example:
p = <p></p>orul>li*3 = <ul> <li>x3 </ul>If it is not an emmet abbreviation, it will only be shown if
Emmet: Expand Abbreviationis explicitly used?So we will no longer be getting results such as
randomword>tab = <randomword></randomword>This would be a perfect solution, as the current implementation either has me choosing between not having any emmet suggestions at all, or having everything I type be turned into a suggestion.
ramya-rao-a commentedon Jul 9, 2017
Correct. Except
pwill not be expanded to<p></p>in the suggestion listI took the example of
imgbecause it is a snippet that expands to<img src="" alt="">Look at https://github.com/emmetio/snippets/blob/master/html.json for all the emmet snippets.
niichie commentedon Jul 9, 2017
This is actually a perfect solution, because in combination with the HTML5 Snippets plugin, you can get both the normal snippets like
div, p, h1as well as the emmet abbreviations. Will we be able to set the emmet abbreviations to take priority when there is a matching snippet?ramya-rao-a commentedon Jul 9, 2017
I believe so, but wont be sure until I actually make the change
ayyash commentedon Jul 14, 2017
I'm going to append to this thread because it looks like the same issues around emmet, recently, emmet lorem, generates a "div" tag around it, this is annoying.
Also on ever "enter" the last word is expanded into a tag, which is not what is really intended, the Tab should be enough (if that is configurable, then the default changed, how can I configure back?)
ramya-rao-a commentedon Jul 14, 2017
That's different.
loremis a valid abbreviation and emmet should have returned without the div. emmetio/atom-plugin#28 is logged as an upstream issue for that.This will be covered in this current issue
ramya-rao-a commentedon Jul 18, 2017
Am back from vacation and conferences, now to some bug fixes :)
Steve Lombardi (@smlombardi) niichie I have pushed a fix to skip emmet suggestions when text is not a known snippet or a form of abbreviation.
Emmet: Expand Abbreviationcommand is not affected by this change.The change will be out in Wednesday's Insiders (19th July)
Do try it out and let me know how it goes.
niichie commentedon Jul 18, 2017
Excited to try this out! Thanks :)
Any idea when the following will be fixed in emmet?
For some reason, the obvious abbreviation is second, even with the full word almost typed out!
ramya-rao-a commentedon Jul 18, 2017
niichie That is being tracked in #29473 for which I just pushed a fix. You should be able to see the change in Wednesday's Insiders (19th July)
ramya-rao-a commentedon Aug 1, 2017
Note to verifier:
Emmet: Expand Abbreviationcommand and the text should get expanded to html tagsdiv,head,body,ul,petc should show up in the emmet suggestionslorem,lorem20, lorem2` etc should show up in emmet suggestionsFixes microsoft#30265 skip emmet expand when text is not snippet or a…