FIXED: No semicolon after tab in CSS and then some more things

Report issues, odd behaviors or submit a detailed bug report.
Post Reply
User avatar
pjj
Posts: 2236
Joined: 13 Oct 2009 13:48
Location: Kraków, Poland

FIXED: No semicolon after tab in CSS and then some more things

Post by pjj »

When I press tab in CSS context (CSS file, <style> tag in HTML file, style attribute of HTML tag), colon and space are inserted, and this is cool. However, it used to be colon, space and semicolon, and it was even cooler. Can we get semicolon back, please?

And while we are @ it: autocomplete (Ctrl-Space) completes the property, inserts colon, space and semicolon inside <style> block, but in CSS files it only completes the property, without adding anything after; the same is with the "style" attribute of HTML tag.

One last thing: font-display property is on the autocomplete list, but not on the keyword list of CSS syntax definition file; I thought these were created from the same source?

No, sorry, another thing: after pressing tab after property name in CSS file I get different window than in <style> block; the latter gives me all named CSS colors and more options (like var(), hsl() etc.), while the former -- shorter list, with these additional options only. I don't know which one is better (I think the shorter, as I can always open Color window), but I guess it should be one list in both places.
Alium tibi quaere fratrem; hic, quem tuum putas, meus est. Titus Flāvius Caesar Vespasiānus Augustus
User avatar
Rickard Johansson
Site Admin
Posts: 6783
Joined: 19 Jul 2006 14:29

Re: No semicolon after tab in CSS and then some more things

Post by Rickard Johansson »

Does v16.30 beta 1 fix the issues?

viewtopic.php?t=5699
User avatar
pjj
Posts: 2236
Joined: 13 Oct 2009 13:48
Location: Kraków, Poland

Re: No semicolon after tab in CSS and then some more things

Post by pjj »

Yes it does --
Image

-- apart from point no 4. For "colo" in autocompletion window I get:
  • <style> section: color, color-adjust, color-interpolation-filters
  • CSS file: color, color-interpolation-filters, color-scheme
The second list seems to be better overall, why not use just one?
Alium tibi quaere fratrem; hic, quem tuum putas, meus est. Titus Flāvius Caesar Vespasiānus Augustus
User avatar
Rickard Johansson
Site Admin
Posts: 6783
Joined: 19 Jul 2006 14:29

Re: No semicolon after tab in CSS and then some more things

Post by Rickard Johansson »

I get the same list in both cases (second one). Are you by any chance using a language server for HTML files?
User avatar
pjj
Posts: 2236
Joined: 13 Oct 2009 13:48
Location: Kraków, Poland

Re: No semicolon after tab in CSS and then some more things

Post by pjj »

Ha! I do, in fact, use CSS server. In another project, where I don't have any LSP registered, I get the same list for CSS.

So for some reason CSS LSP server is not used for .css files (nor .scss), and when it is used (in <style> section), it displays its own hints, that are different than hints from RJ TE's own list (taken from MDN or caniuse, don't remember) -- am I getting this right? (In LSP config I have these necessary lines for files' extensions with CSS content: .css, .less & .scss)
Alium tibi quaere fratrem; hic, quem tuum putas, meus est. Titus Flāvius Caesar Vespasiānus Augustus
User avatar
Rickard Johansson
Site Admin
Posts: 6783
Joined: 19 Jul 2006 14:29

Re: No semicolon after tab in CSS and then some more things

Post by Rickard Johansson »

To me it looks like you're using a HTML server. It should use it's own list between style tags, but not inside CSS files... :?

(The HTML server should provide both HTML and CSS auto completion inside HTML files, but ignore other files like CSS files.)
User avatar
pjj
Posts: 2236
Joined: 13 Oct 2009 13:48
Location: Kraków, Poland

Re: No semicolon after tab in CSS and then some more things

Post by pjj »

Maybe my HTML server is pretending to be CSS one?
lsp-1.png
lsp-1.png (35.68 KiB) Viewed 4288 times
Please notice it's saying that the server is not running, but it is! When I start the server and restart the editor, the message is the same (i.e. it's not running).
lsp-2.png
lsp-2.png (29.42 KiB) Viewed 4288 times
Perhaps sometime later I'll remove all LSP servers and reinstall them.
Alium tibi quaere fratrem; hic, quem tuum putas, meus est. Titus Flāvius Caesar Vespasiānus Augustus
User avatar
Rickard Johansson
Site Admin
Posts: 6783
Joined: 19 Jul 2006 14:29

Re: No semicolon after tab in CSS and then some more things

Post by Rickard Johansson »

The PHP Intelephense server handles HTML/JS/CSS auto completion as well (inside HTML files). So the list you're seeing in <style> blocks are produced by PHP Intelephense...
User avatar
pjj
Posts: 2236
Joined: 13 Oct 2009 13:48
Location: Kraków, Poland

Re: No semicolon after tab in CSS and then some more things

Post by pjj »

You're right, it takes care about CSS :shock:

So now what seems to be the problem ("What seems to be a problem, Officer?" -- Ed Harris in A History of Violence) is how I make my CSS LSP server work on CSS files. (I need to start it, and I can't.) OK, I'll do some tests.

Btw. when I add this line

Code: Select all

.css=php
to LSP settings and put <style> tag at the beginning of CSS file, LSP Intelephense server shows its hints, but it isn't the way to go, is it?

Btw.clicking on [-] in the same window does not delete a line, but merely lets you edit it, so now this section looks like this:

Code: Select all

.php=php
=
=
and even restart doesn't remove those lines.
Alium tibi quaere fratrem; hic, quem tuum putas, meus est. Titus Flāvius Caesar Vespasiānus Augustus
User avatar
pjj
Posts: 2236
Joined: 13 Oct 2009 13:48
Location: Kraków, Poland

Re: No semicolon after tab in CSS and then some more things

Post by pjj »

Strangest thing, but it does not work for me at all (<style>, style="", CSS) in the released version (16.30). After a tab only spaces are inserted, same with autocomplete. On my other computer it works alright, though :? Any ideas?

Edit: some time ago I had switched off tab as trigger key in Format > Abbreviations > Allow trigger keys. I switched it on and the desired behavior is back. Good, but I don't think that switching tab off for Emmet should all of a sudden entail switching it off for CSS :?
Alium tibi quaere fratrem; hic, quem tuum putas, meus est. Titus Flāvius Caesar Vespasiānus Augustus
User avatar
Rickard Johansson
Site Admin
Posts: 6783
Joined: 19 Jul 2006 14:29

Re: No semicolon after tab in CSS and then some more things

Post by Rickard Johansson »

Fixed in next release (16.31). Thanks!
Post Reply