wkillerud / some-sass

Improved support for SCSS, Sass indented and SassDoc. Workspace awareness and full support for Sass modules.
https://wkillerud.github.io/some-sass/
60 stars 6 forks source link

Color references not always working in Sublime Text #252

Closed niksy closed 1 month ago

niksy commented 1 month ago

In which editor is this a problem?

Sublime Text

Describe the bug

When using only Sass LSP this is what code looks like:

Screenshot 2024-10-05 at 12 03 35

Compare it with when CSS LSP is also used for that same code:

Screenshot 2024-10-05 at 12 02 33

Notice how $hello variable gets it’s value recognized as color.

I tried setting enabling somesass.css.colors.enabled but it doesn’t do anything.

What's the expected result?

Colors are always recognized inside code.

Link to minimal reproducible example

No response

Participation

wkillerud commented 1 month ago

Hi @niksy

I installed the latest LSP-sass and noticed the default setting somesass.scss.colors.includeFromCurrentDocument is set to false. The setting name is a bit imprecise, looking at it now. If you set it to true it will turn on color decorators for SCSS variable declarations and CSS colors in the open SCSS document.

This is with the setting set to true.

a variable declaration with a red color decorator next to it

niksy commented 1 month ago

Yes, I’ve been using defaults from https://wkillerud.github.io/some-sass/user-guide/settings.html where that value is mentioned as false by default. Is this not true? Should this be updated?

Where can we find full default values list? Is it this file: https://github.com/wkillerud/some-sass/blob/main/packages/language-services/src/configuration.ts

wkillerud commented 1 month ago

Yes, I’ve been using defaults from https://wkillerud.github.io/some-sass/user-guide/settings.html where that value is mentioned as false by default. Is this not true? Should this be updated?

It's correct for the Visual Studio Code extension, which has different defaults from the language server itself. You highlight a good point though. Correct documentation of settings default values is missing for language server users. I opened #255

Where can we find full default values list? Is it this file: https://github.com/wkillerud/some-sass/blob/main/packages/language-services/src/configuration.ts

Yes, those are the default settings used by the language server.

niksy commented 1 month ago

Okay, this is it. Now I need to figure out how to disable Volar color implementation and leave only Some Sass active.

Screenshot 2024-10-07 at 20 06 24

niksy commented 1 month ago

Okay, closing this since this is now fixed, Volar related issue is a different beast :)

niksy commented 1 month ago

Seems like it can be Sublime LSP issue: https://github.com/sublimelsp/LSP/issues/2534