vscode-scss icon indicating copy to clipboard operation
vscode-scss copied to clipboard

prompts don't work correctly when using @use with namespace

Open flamebergh opened this issue 4 years ago • 6 comments

  • VS Code Version: 1.44
  • SCSS IntelliSense Version: Version: 0.9.0
  • Operating System: Windows 10

Reproducible Case: the extension's prompts working correctly with @use only when importing with asterisk like @use 'firstfile' as *

Steps to Reproduce:

  1. create 2 scss files
  2. in first file write some mixin
  3. in second file import first file with namespace as @use 'first' or like @use 'first' as mixins;
  4. try to use your mixin as @include first. or @include mixins. then you won't see some suggest. And it will never suggest you the namespace (first or mixin, that we used before)

flamebergh avatar Apr 08 '20 09:04 flamebergh

The Issue

Both @use and @forward are treated as @import. It works, but it means you can't use anything like namespaces. In addition, placeholder selectors from modules don't show up on IntelliSense at all.


Stuff that needs fixin‘

bkeys818 avatar Feb 05 '21 16:02 bkeys818

This should definitely be implemented. It has now been about 2/3 years that the new module system (i.e. @use/@forward) has been added to Sass, but we still don't have proper intellisense for it :( @mrmlnc Any ideas, Denis?

aradalvand avatar Jul 09 '21 00:07 aradalvand

I agree on @AradAral request.

@import is deprecated already and using namespaces is the default behaviour.

Imho, Intellisense should look for imported modules in the current sass file only and using the new dart-sass syntax. This should improve speed and would be much more efficient since it would only suggest vars that you actually needs.

baticodes avatar Oct 14 '21 08:10 baticodes

Holy moley, this isn't implemented yet? So there isn't any Intellisense supporting this?

tunttunen avatar Oct 04 '22 13:10 tunttunen

Are there any alternative extensions which could handle namespaces at the moment?

tobradex avatar Dec 05 '22 10:12 tobradex

@tobradex and anyone else in the same boat, check out the Some Sass extension. I haven't tried it with all of the newer Sass features, but it claims to work with @use. The developer frequently updates it, so it seems much more likely to have support added for issues raised there.

zachhardesty7 avatar Sep 19 '23 17:09 zachhardesty7