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
New emmet: css property width expands to widows?? #28933
Not sure what expected behaviour should be if you type full property name and try to expand it as Emmet abbreviation. CSS itself has too much clashing properties/abbreviations. The goal of shortcuts is to provide shorthands for most commonly used properties. Users should learn these shortcuts by typing first letters and seeing autocomplete popup with available options. If the full property names will be considered in abbreviation resolving, they will collide with shorthands, especially ones with embedded shorthand values, like m-a for margin: auto.
So the ultimate goal is to provide matched snippets and expanded abbreviation with previews
Sergey Chikuyonok (@sergeche) In this case the only match between "padd" and the suggested shorthand "pgba" is the first letter "p". Aren't we being too eager while matching here?
Indeed, this eager matching to the Emmet shorthands severely breaks (this) user expectations.
When I have almost complete property name, like "borde", "paddin", "margi", etc, I would assume that VS Code does the right thing and expands these widely-used properties. Instead, I get completely random and unrelated (at least that's how it looks) suggestions from Emmet.
My expectation would be that Emmet's suggestions should not always be the number 1 in the suggestion list, and sometimes they should be ranked lower as compared to the almost fully-matched widely used properties.
Suggesting "pgba" shorthand as a top choice for "paddin" is just wrong (at least, to me).
One solution I have in mind here is for the css completion provider (from the css extension that is built in) to call the emmet completion provider (See #29114 (comment)) instead of the emmet extension.
As the css extension will also have in hand the other suggestions, it can add some logic to filter/sort appropriately.
I'll look into that next week.
Until then, I am pushing the below changes
The label in the completion item for emmet will now show the expanded abbreviation and not the abbreviation itself. With this, it will be more clear as to what exactly is the user choosing.
For sorting, the expanded abbreviation will be used and not the abbreviation itself.
The changes will be out in Monday's Insiders build.
Please give it a try then and let me know how the improvements work out for you.
If things are reasonable, then I'll push the work on the css completion provider to next iteration.
Hi Ramya Rao (@ramya-rao-a) , many thanks for the improvements, they significantly improve the user experience w.r.t editing CSS/SCSS files!
The sorting of the suggestions is much, much better now.
There is one issue though (actually two), regarding snippets.
Say, I have a snippet called bidi (for bi-directional SCSS mix-ins).
== Issue 1 ==
I type 'b' and see the following:
The help for my snippet bidi is wrong.
== Issue 2 ==
When I type the full name of the snippet, bidi in this case, it is still listed below the Emmet suggestion (which seems completely unrelated to the name of my snippet):
I'm still running into issues with emmet and specifically the width shorthand.
white-space and widows both get priority over width which arguably is one of the most commonly used properties. Is there any way we can reorder the priority and shift some of these lesser-used properties further down the list?
Or you can take advantage of emmet and instead of typing wid you could say type w10 which would expand to width: 10px (you can use any number instead of 10)
Activity
ramya-rao-a commentedon Jun 17, 2017
I am having a deja vu :)
wgiveswidthwiand anything further giveswidowsThis is coming from the way snippets are defined in https://github.com/emmetio/snippets/blob/master/css.json
Sergey Chikuyonok (@sergeche) thoughts?
cc Sergey Chikuyonok (@sergeche)
druellan commentedon Jun 17, 2017
I'm starting to get similar results with other properties:
the default hint for
font-familyisfont: fantasy;which is a very loose association and ruins the hinting systemjens1o commentedon Jun 17, 2017
but then I would expect that the label updates too...
sergeche commentedon Jun 17, 2017
Not sure what expected behaviour should be if you type full property name and try to expand it as Emmet abbreviation. CSS itself has too much clashing properties/abbreviations. The goal of shortcuts is to provide shorthands for most commonly used properties. Users should learn these shortcuts by typing first letters and seeing autocomplete popup with available options. If the full property names will be considered in abbreviation resolving, they will collide with shorthands, especially ones with embedded shorthand values, like
m-aformargin: auto.So the ultimate goal is to provide matched snippets and expanded abbreviation with previews
ramya-rao-a commentedon Jun 21, 2017
Another example:
User expectation would be to match "padding"
Sergey Chikuyonok (@sergeche) In this case the only match between "padd" and the suggested shorthand "pgba" is the first letter "p". Aren't we being too eager while matching here?
vvs commentedon Jun 23, 2017
Indeed, this eager matching to the Emmet shorthands severely breaks (this) user expectations.
When I have almost complete property name, like "borde", "paddin", "margi", etc, I would assume that VS Code does the right thing and expands these widely-used properties. Instead, I get completely random and unrelated (at least that's how it looks) suggestions from Emmet.
My expectation would be that Emmet's suggestions should not always be the number 1 in the suggestion list, and sometimes they should be ranked lower as compared to the almost fully-matched widely used properties.
Suggesting "pgba" shorthand as a top choice for "paddin" is just wrong (at least, to me).
Absorb change that will give better ordering for emmet css #28933
ramya-rao-a commentedon Jun 24, 2017
One solution I have in mind here is for the css completion provider (from the css extension that is built in) to call the emmet completion provider (See #29114 (comment)) instead of the emmet extension.
As the css extension will also have in hand the other suggestions, it can add some logic to filter/sort appropriately.
I'll look into that next week.
Until then, I am pushing the below changes
The changes will be out in Monday's Insiders build.
Please give it a try then and let me know how the improvements work out for you.
If things are reasonable, then I'll push the work on the css completion provider to next iteration.
Again, thanks for all the feedback!
jens1o commentedon Jun 25, 2017
temporary fixed with microsoft/vscode-emmet-helper@2bbf018
ramya-rao-a commentedon Jun 26, 2017
I have logged #29113 to track the work of moving emmet completion provider to css language service.
Closing this issue for the June milestone as the improvements listed in #28933 (comment) should help most of the cases.
ramya-rao-a commentedon Jun 26, 2017
Note to verifier:
vvs commentedon Jun 26, 2017
Hi Ramya Rao (@ramya-rao-a) , many thanks for the improvements, they significantly improve the user experience w.r.t editing CSS/SCSS files!
The sorting of the suggestions is much, much better now.
There is one issue though (actually two), regarding snippets.
Say, I have a snippet called
bidi(for bi-directional SCSS mix-ins).== Issue 1 ==
I type 'b' and see the following:
The help for my snippet
bidiis wrong.== Issue 2 ==
When I type the full name of the snippet,
bidiin this case, it is still listed below the Emmet suggestion (which seems completely unrelated to the name of my snippet):Should I file separate issues for that?
ramya-rao-a commentedon Jun 26, 2017
Vladimir Sizikov (@vvs) wow, the first issue is seriously messed up, thanks for reporting!
This is a separate issue indeed. I have logged #29468
ekfuhrmann commentedon Oct 2, 2017
I'm still running into issues with emmet and specifically the
widthshorthand.white-spaceandwidowsboth get priority overwidthwhich arguably is one of the most commonly used properties. Is there any way we can reorder the priority and shift some of these lesser-used properties further down the list?Gif below to show what I'm seeing...
ramya-rao-a commentedon Oct 2, 2017
Eric Fuhrmann (@ekfuhrmann) You can set a custom emmet snippet for
widSee Using Custom Snippets in Emmet
Or you can take advantage of emmet and instead of typing
widyou could say typew10which would expand towidth: 10px(you can use any number instead of 10)