-
-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug: inconsistency with the intelliSense autocompletion #210
Comments
Love your eye for detail 🙌 Why the inconsistencies?
The reason these two complete differently is a bit involved.
To avoid duplicates, by default Some Sass does not provide suggestions for symbols (variables, functions, mixins) declared in the same document. There's a setting that can be tweaked to add them.
Similar story here, this suggestion comes from VS Code's language feature. They chose to have named parameters, something I didn't really catch when I implemented my approach which just uses unnamed arguments.
This is where Some Sass takes over and works as designed. I chose unnamed arguments for some reason, just a preference I suppose 😅
I think this is related to #209, in that the completion doesn't find the function signature for What to do?I think ultimately there is no way for us to make this consistent without coordinating with upstream/VS Code (which is probably doable, but takes work and time). I think this would end up as a user setting, kind of like Suggestion style is now for with/without brackets/both.
VS Code would need to add support for the same setting, and ensure internal consistency themselves. Then we could follow. About your other observations.
Some times folks might want to pass in a number or a string directly, not a variable, so I don't think that's the right move. A function I used to use a lot in a previous codebase was a
That opens up a can of worms with when it should and shouldn't insert semicolons, so that's not something I want to do unfortunately.
|
I get it now. When updating the option /// A dummy variable.
/// @type {String}
$dummy: 'dummy';
/// A dummy function.
/// @return {String} - the `$dummy` variable
@function dummy() {
@return $dummy;
} With The first 2 lines With With I am not sure I understand what is considered an "open document" from the option In the first screenshot, why do I see the function When using When working in a file, to make my development easier, I would like the suggestions to reflect everything that is related to the |
Sorry it was not clear, I was targeting the autocomplete placeholder itself, the $ sign would be displayed in it. For example, the autocomplete
I see your point, good catch! There could be some conditions, but it might involve a lot of logic.
I guess that's what you meant by |
The approach as for |
Reproducible Case:
https://github.com/MenSeb/some-sass-bug/tree/main/src/some-sass-completion
Steps to Reproduce:
I think there may be some inconsistencies when using the autocomplete feature.
From the test file
index.scss
, when something comes from :dummy
, it will autocomplete without the$value
param.test
, it will autocomplete with thevalue
param.math.compatible
, it will autocomplete withnumber1
andnumber2
params.comparable
, it will autocomplete with$number1:
and$number2:
params.color-blue
, it will autocomplete without the parentheses and params.The cursor behavior:
It can be place over the param name, e.g.
value
and ready to replace it.It can be place after the param name, e.g.
$number1:
and ready to add something.What could be done?
Depending on user preferences, possible options could be, for example:
comparable($number1: , $number2: )
and pressing tab would move through each param to add a value.useNamedParams
from the configuration.Other observations:
Could the autocomplete on a param include the
$
dollar sign by default? So$value
instead ofvalue
.Could the autocomplete automatically insert the
;
semicolon at the end of the line?I am not sure if this is all related to the extension itself, please let me know if it is.
The text was updated successfully, but these errors were encountered: