sveltejs / language-tools

The Svelte Language Server, and official extensions which use it
MIT License
1.26k stars 200 forks source link

Global SCSS Autocomplete #241

Open daarxwalker opened 4 years ago

daarxwalker commented 4 years ago

Is your feature request related to a problem? Please describe. Global SCSS variables does not offer autocomplete in component.

Describe the solution you'd like When typing in component style (scss), it should offering me autocomplete options by global variables. Maybe with some reference file, or by svelte.config.js

dummdidumm commented 4 years ago

I'm not sure if we want to implement this in here or if we should leave that to other extensions who deal with scss syntax specifically. I created this issue over at the popular SCSS Intellisense extension repo. Also, from reading the docs, it seems that this extension may already support this.

daarxwalker commented 4 years ago

@dummdidumm I have this extension and it doesn't work.

ivanhofer commented 2 years ago

Looks like the SomewhatStationery.some-sass extension provides that feature

bertybot commented 1 year ago

Yo coming to this issue because I have a lot of miscellaneous issues using Sass in Svelte with VSCode.

For background I am currently running a monorepo using turbo with a Sveltekit app in folder apps/web and Svelte component libraries in packages folder. I am using SomewhatStationery.some-sass and Svelte VSCode plugin. I have a Sass variables file in node_modules that I access a lot everywhere.

Biggest problem I have right now is that the Svelte VSCode flags every single one of my Svelte files as errored if I try to @use the Sass variables file in node_modules

Error in referenced file

Error: Can't find stylesheet to import. ╷ 2 │ @use '@ashcomm/design-tokens/variables'; │ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ╵ packages/content-components/components/ContentPage.svelte.vite-preprocess.scss

I am pretty sure this is an error with this extension because everything builds correctly. It's just very frustrating and Idk how to fix it.

Also in relation to this issue in particular the Sass extension resolves the variables correctly once they are written. but, I get no autocomplete while writing them. Which is also annoying. Does anyone know how to fix this stuff?

Like I feel like I just need a Godlike example of how to setup Sass with Svelte with good DX LoL.