Skip to content
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

[css] add semicolon on value completion #32200

Closed
DamianPereira opened this issue Aug 9, 2017 · 21 comments · Fixed by microsoft/azuredatastudio#7206
Closed

[css] add semicolon on value completion #32200

DamianPereira opened this issue Aug 9, 2017 · 21 comments · Fixed by microsoft/azuredatastudio#7206
Assignees
Labels
css-less-scss Issues and items concerning CSS,Less,SCSS styling feature-request Request for new features or functionality on-testplan

Comments

@DamianPereira
Copy link

  • VSCode Version: Code 1.14.2 (cb82feb, 2017-07-19T23:26:08.116Z)
  • OS Version: Linux x64 4.4.0-89-generic

Steps to Reproduce:

  1. Trigger a sugestion for a value of a css property (for example, writing c after align-items: )
  2. Select a suggestion from the list (for example: center)
  3. 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.

@vscodebot vscodebot bot added the css-less-scss Issues and items concerning CSS,Less,SCSS styling label Aug 9, 2017
@dnecklesportfolio
Copy link

This is would be absolutely awesome, thanks for posting this.

@aeschli aeschli added the feature-request Request for new features or functionality label Aug 10, 2017
@aeschli aeschli added this to the Backlog milestone Aug 10, 2017
@bymomo
Copy link

bymomo commented Sep 11, 2017

support

@aeschli aeschli 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. Sep 12, 2017
@aeschli aeschli changed the title [css] Automatically add semi-colon after value suggestion on css and similar files. [css] add semicolon on value completion Dec 4, 2017
@1-800-jono
Copy link

Why is this closed? Already done?

@aeschli
Copy link
Contributor

aeschli commented Feb 7, 2018

It's not closed...

@octref
Copy link
Contributor

octref commented 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. @aeschli What do you think?

@yyynnn
Copy link

yyynnn commented 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
Copy link

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
Copy link

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...

@budislav
Copy link

Oh yes, add semicolon on value completion is really needed.

@johnasp
Copy link

johnasp commented Aug 23, 2018

I just searched for a solution to this and stumbled across this thread. This bug is so incredibly ANNOYING! Incredible they have shipped VS without fixing this first.

@nemanjacosovic
Copy link

nemanjacosovic commented Dec 1, 2018

Not having colon after the property, this is the dumbest "feature" of VSCode by far. I've been using VSCode it for a year now and I found myself absolutely hampered while writing code.

Back in the days #Macromedia's Dreamweaver was the tool. Wish it would come back in some form. Dreamweaver 8 was such great tool before Adobe ruined it. I guess phpStorm/webStorm is the only way to go today in order to have a normal editor. I like Sublime and Coda, but jetBrains is blowing everyone out of the water. But, I'm going off topic...

Again, it is completely unbelievable that this was shipped like this, and that it even had so many updates not having this implemented.

Do you even CSS?

@aeschli
Copy link
Contributor

aeschli commented Jan 4, 2019

@nemanjacosovic We already add a colon after the property name. I assume you mean semicolon after the value?

@octref
Copy link
Contributor

octref commented 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 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:
    image

  • 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.

@yyynnn
Copy link

yyynnn commented May 22, 2019

@aeschli no, he means this:

image
And this should trigger all available values that prop supports. Like in Atom.
This is truly revolting.

@aeschli
Copy link
Contributor

aeschli commented May 23, 2019

@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
Copy link

am-awais commented Jul 30, 2019

Can anyone help how to active auto colons after completing css properties like

display:

how to add ( : ) automatically in Visual studio 2017 not visual code

@octref
Copy link
Contributor

octref commented Aug 9, 2019

I'm wondering what exactly are you all asking. Please upvote below three posts accordingly.

@octref
Copy link
Contributor

octref commented Aug 9, 2019

VS Code. Proposed change:

  • Insert semicolon at end
  • Automatically trigger property value completion

vsc

@octref
Copy link
Contributor

octref commented Aug 9, 2019

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

atom1

@octref
Copy link
Contributor

octref commented Aug 9, 2019

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.

atom2

octref added a commit to microsoft/vscode-css-languageservice that referenced this issue Sep 11, 2019
@octref octref closed this as completed in 4dec1f7 Sep 11, 2019
@octref
Copy link
Contributor

octref commented Sep 11, 2019

css

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
css-less-scss Issues and items concerning CSS,Less,SCSS styling feature-request Request for new features or functionality on-testplan
Projects
None yet
Development

Successfully merging a pull request may close this issue.

14 participants