Open MenSeb opened 3 months ago
Heh, I was waiting for this one 🙈
The current implementation is pretty basic. If we haven't found a better suggestion we look through the list of Sass modules and see if we find a literal match on the name. To avoid showing that info in case of a naming collision with CSS we also only do it if it's used as a module.
@use "sass:math";
@debug math.$pi;
Since we don't have the actual source SCSS of these modules there's no document to link to and parse, so the usual logic of the language server doesn't apply 😞
To make this consistent (especially if @forward
ed and prefixed) is probably going to be a lot of work, and is not high on my list of priorities to be honest 😅
anything that was forwarded with prefix
Just to be sure: are you forwarding some of your own variables, functions, mixins with a prefix (as opposed to from sass:
modules)? Hover info should work for whose.
anything that was forwarded with prefix
Just to be sure: are you forwarding some of your own variables, functions, mixins with a prefix (as opposed to from
sass:
modules)? Hover info should work for whose.
Yes it works. The repo was updated with this specific case.
// _hover.scss
/// Hover!
/// @return {String} - "hover"
@function hover() {
@return 'hover';
}
// _test.scss
@forward './hover' as hover-*;
// index.scss
@use './test' as *;
// This shows the information on hover
@debug hover-hover();
Heh, I was waiting for this one 🙈
haha sorry, I know some are very specific cases...
The current implementation is pretty basic. If we haven't found a better suggestion we look through the list of Sass modules and see if we find a literal match on the name. To avoid showing that info in case of a naming collision with CSS we also only do it if it's used as a module.
@use "sass:math"; @debug math.$pi;
Interesting, I think this reminded me of another edge case that might be a bug, I will try to replicate it again.
Since we don't have the actual source SCSS of these modules there's no document to link to and parse, so the usual logic of the language server doesn't apply 😞
To make this consistent (especially if
@forward
ed and prefixed) is probably going to be a lot of work, and is not high on my list of priorities to be honest 😅
I understand and agree with you, this specific case of global alias is not a priority, I just wanted to let you know about it. The only priority might be about the information not displayed for a prefixed forward.
Reproducible Case:
https://github.com/MenSeb/some-sass-bug/tree/main/src/some-sass-hover
Steps to Reproduce:
There seems to be some inconsistency in displaying information on hover.
It does not work for SASS global aliases and anything that was forwarded with prefix.