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
Trigger a sugestion for a value of a css property (for example, writing c after align-items: )
Select a suggestion from the list (for example: center)
Now you have to write ;
It would be nice if selecting suggestions added the semi colon at the end automatically, like atom does on css/scss files. AFAIK there's no way to configure this in current VSCode, maybe a setting could be provided if it's too strong for a default.
changed the title [-]Automatically add semi-colon after value suggestion on css and similar files.[/-][+][css] Automatically add semi-colon after value suggestion on css and similar files.[/+]on Sep 12, 2017
changed the title [-][css] Automatically add semi-colon after value suggestion on css and similar files.[/-][+][css] add semicolon on value completion[/+]on Dec 4, 2017
There is no way to do this consistently -- for properties that have enum property values we can auto-complete the semicolon, but for others we can't. Also there is the case of !important, so if we add the semicolon this might cause trouble to certain people instead of helping them.
I'm in favor of having consistency and not doing this. Martin Aeschlimann (@aeschli) What do you think?
Screw semi colon, add colon - this is crucial! Not having colon after prop complete breaking flow so much. This is implemented in atom, so why no love for vscode?
a way it could work constantly is to add it wenn you put in the "align-items" it autocompletes to "align-items: ;" and the cursor is placed right in front of the semicolon so you can add in one or multiple values...
I guess this comes as part of property value completion. I think the best solution is to use https://github.com/csstree/csstree to understand the syntax for each CSS property and offer valid completions.
The current problem:
If you are writing position: and chose relative, then we can safely close the line with a ;
But imagine if you are writing flex-flow: and chose row. You might want to continue writing row nowrap so we shouldn't close it with a semicolon.
Completing with semicolon and putting cursor in the middle might be problematic too. For example emmet:
Now after writing the values, I need to press right to get pass the ; at the end to open a new line. This is annoying.
Sergio (@yyynnn) Please file a separate issue: This issue is about the semicolon. We already add colons for properties (but don't show this in the proposal label)
Atom. Complete property value with semicolon. I feel when using css properties like font-family, animation etc, this can backfire and be unpleasant. Atom doesn't seem to do any completion for animation
Atom, by pressing tab instead of enter to complete. Let's ignore the prefixes. The idea seems to be close to what I proposed for VS Code, it's just you need to manually trigger property value completion in Atom whereas VS Code can do it automatically.
Activity
dnecklesportfolio commentedon Aug 10, 2017
This is would be absolutely awesome, thanks for posting this.
bymomo commentedon Sep 11, 2017
support
[-]Automatically add semi-colon after value suggestion on css and similar files.[/-][+][css] Automatically add semi-colon after value suggestion on css and similar files.[/+][-][css] Automatically add semi-colon after value suggestion on css and similar files.[/-][+][css] add semicolon on value completion[/+]1-800-jono commentedon Feb 7, 2018
Why is this closed? Already done?
aeschli commentedon Feb 7, 2018
It's not closed...
octref commentedon May 10, 2018
There is no way to do this consistently -- for properties that have enum property values we can auto-complete the semicolon, but for others we can't. Also there is the case of
!important, so if we add the semicolon this might cause trouble to certain people instead of helping them.I'm in favor of having consistency and not doing this. Martin Aeschlimann (@aeschli) What do you think?
yyynnn commentedon Jul 19, 2018
Screw semi colon, add colon - this is crucial! Not having colon after prop complete breaking flow so much. This is implemented in atom, so why no love for vscode?
dmikester1 commentedon Aug 9, 2018
I don't see any reason why this couldn't be added as an option in the settings. Leave it disabled by default and people who want it could enable it.
TomsPoint commentedon Aug 19, 2018
a way it could work constantly is to add it wenn you put in the "align-items" it autocompletes to "align-items: ;" and the cursor is placed right in front of the semicolon so you can add in one or multiple values...
4 remaining items
octref commentedon Jan 4, 2019
I guess this comes as part of property value completion. I think the best solution is to use https://github.com/csstree/csstree to understand the
syntaxfor each CSS property and offer valid completions.The current problem:
If you are writing
position:and choserelative, then we can safely close the line with a;But imagine if you are writing
flex-flow:and choserow. You might want to continue writingrow nowrapso we shouldn't close it with a semicolon.Completing with semicolon and putting cursor in the middle might be problematic too. For example emmet:

Now after writing the values, I need to press
rightto get pass the;at the end to open a new line. This is annoying.yyynnn commentedon May 22, 2019
Martin Aeschlimann (@aeschli) no, he means this:
And this should trigger all available values that prop supports. Like in Atom.
This is truly revolting.
aeschli commentedon May 23, 2019
Sergio (@yyynnn) Please file a separate issue: This issue is about the semicolon. We already add colons for properties (but don't show this in the proposal label)
am-awais commentedon Jul 30, 2019
Can anyone help how to active auto colons after completing css properties like
how to add ( : ) automatically in Visual studio 2017 not visual code
octref commentedon Aug 9, 2019
I'm wondering what exactly are you all asking. Please upvote below three posts accordingly.
octref commentedon Aug 9, 2019
VS Code. Proposed change:
octref commentedon Aug 9, 2019
Atom. Complete property value with semicolon. I feel when using css properties like
font-family,animationetc, this can backfire and be unpleasant. Atom doesn't seem to do any completion foranimationoctref commentedon Aug 9, 2019
Atom, by pressing
tabinstead ofenterto complete. Let's ignore the prefixes. The idea seems to be close to what I proposed for VS Code, it's just you need to manually trigger property value completion in Atom whereas VS Code can do it automatically.completePropertyWithSemicolon support for microsoft/vscode#32200
octref commentedon Sep 11, 2019
After you are done writing a value, you can open a new line below by Cmd+Enter or Ctrl+Enter to avoid making the semicolon after you go to new line.
You can control this behavior with
css.completion.completePropertyWithSemicolon.