Page 1 of 1
FIXED: No semicolon after tab in CSS and then some more things
Posted: 13 Aug 2024 11:57
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.
Re: No semicolon after tab in CSS and then some more things
Posted: 24 Aug 2024 17:16
by Rickard Johansson
Does v16.30 beta 1 fix the issues?
viewtopic.php?t=5699
Re: No semicolon after tab in CSS and then some more things
Posted: 25 Aug 2024 10:36
by pjj
Yes it does --
-- 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?
Re: No semicolon after tab in CSS and then some more things
Posted: 25 Aug 2024 12:30
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?
Re: No semicolon after tab in CSS and then some more things
Posted: 25 Aug 2024 13:14
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)
Re: No semicolon after tab in CSS and then some more things
Posted: 25 Aug 2024 14:47
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.)
Re: No semicolon after tab in CSS and then some more things
Posted: 25 Aug 2024 20:02
by pjj
Maybe my HTML server is pretending to be CSS one?

- lsp-1.png (35.68 KiB) Viewed 4286 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 (29.42 KiB) Viewed 4286 times
Perhaps sometime later I'll remove all LSP servers and reinstall them.
Re: No semicolon after tab in CSS and then some more things
Posted: 26 Aug 2024 08:30
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...
Re: No semicolon after tab in CSS and then some more things
Posted: 26 Aug 2024 09:22
by pjj
You're right, it takes care about CSS
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
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:
and even restart doesn't remove those lines.
Re: No semicolon after tab in CSS and then some more things
Posted: 02 Oct 2024 10:21
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

Re: No semicolon after tab in CSS and then some more things
Posted: 03 Oct 2024 16:51
by Rickard Johansson
Fixed in next release (16.31). Thanks!