I just recently started to use ST3 (from VSCode). Back in VSCode when I’m editing css (scss) files and when I hover over the style it displays a visual clue on how the class will be applied in the html structure. Is there any similar functionality/package which I can use to get the same feature. Plus it would be nice if there is some quick info feature as well for css(scss) files.
Thanks for this. I installed LSP and vscode-css-languageserver-bin. I also went to Preferences->Package Settings->LSP->Settings and added the following
Now when I try LSP->Enable Language Server in the command palette I don’t see an option for css.
I think this step might not be required since its already enabled with the values under the “client” section. How do I get the pop up working as shown in my initial screenshot? Plus none of the shortcut keys like ctrl+. seem to be working.
Plus when I try to look at the LSP diagnostics I see nothing.
I think I’m missing a step, would appreciate some help.
Thanks, after messing around a lot I got it working. I want to do the same for the .scss files. To that end I have the following entry in the settings file
However this is not working and again the console is not showing anything. I think its primarily because its not detecting the type properly, the syntax shows it as “scss” but its not running the LSP Server.
Maybe you need to add it’s syntax to the entry, you first need to install the Sass package.
And you don’t need a new entry for sass anyway, just add the scope and syntax on top of your vscode-css settings and make sure the scope is correct (open an scss file and press ctrl+alt+m to show the scope name).
I haven’t tried it yet, but i’ll see later.
However when I open a .js or .ts file the server does not do anything, (actually I think it starts) however none of the shortcut keys seem to work. I have installed the required packages as well.
Sometimes the value of languageId determines the processing that language server enables so for CSS/SCSS (vscode-css-languageservice) it might matter which one is passed and thus one might need to create two different client entries for css and scss. I haven’t verified with the source code if it’s actually the case but I had this issue with vue-ls (also made by Microsoft).
There was an upgrade to the scss syntax page last night and now the scope shows “source.scss.scss” When I change the setting it still does not work and I see the following error
LSP: no config found or enabled for view "layout.component.scss"
I also installed another package “syntax highlighting for sass” and this initially shows scope name as “source.scss” However I get the same error here as well.