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 5 forks source link

bug: suggestions shown from unimported packages #203

Closed MenSeb closed 1 month ago

MenSeb commented 1 month ago

Hello,

I am not sure if this is related to a specific package but I was able to reproduce the bug with sass-true since it exists in the repository.

There seems to have suggestions of the exports from sass-true even if it was not exported with the @use statement.

Reproducible Case:

https://github.com/MenSeb/some-sass-bug/tree/main/src/bug-sass-true

Steps to Reproduce:

// _modules.scss
@forward "sass:color" as color-*;
@forward "sass:string" as string-*;
// index.scss
@use './modules' as *;

// It seems that the 'sass-true' package gets exposed.
// The packages color and string are correctly shown 
// under their prefix color- and string- from the @use.

// This works correctly and is shown in suggestions
@debug color-blue(#fff);
@debug string-unique-id();

// This is undefined and should not be shown in suggestions
@debug $catch-errors;
image
wkillerud commented 1 month ago

Huh, that's interesting! At first I thought it was because of the suggest from use only setting, but even with that on I get the $catch-errors suggestion.

It goes away if I comment out this @forward (and reload the window/restart VS Code), so somehow the suggestions code ends up there and follows the link to sass-true when it's not supposed to.

wkillerud commented 1 month ago

Turned out the server ignored user settings for completions (oops!). From 3.6.1 suggest from use only works as expected again, and you shouldn't see $catch-errors in this case.

MenSeb commented 1 month ago

Oh well actually on my side I forgot to use the suggestFromUseOnly option... nice catch anyway haha

Thanks it is now working as expected and I don't see the suggestions from pkg:sass-true.