You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
VSCode has started to push CSS Variables into the auto-complete list, when the variables are defined in the same file that a user is working on.
This causes unnecessary duplicates as mentioned here: #66 (comment)
This bug is opened to find if there's any possible way to fix this issue.
I feel there's one way to fix this: do not populate the auto-complete list (with variables from a source file which is what the user is currently working on as well. (This applies to only CSS and similar files)
Just a thought, need to test this, and figure out if this is functional and fixes the issue or not.
The text was updated successfully, but these errors were encountered:
Yeah, precedence of variables is a challenge. We can keep a context of where the variables were created, but I still feel it wouldn't solve our problem, cause variables can be defined anywhere, and could also be nested.
if it removes the duplicates from folders above.
I couldn't understand this statement. Which folders are you talking about?
I couldn't understand this statement. Which folders are you talking about?
Example
index.css ; with variable --var1: red
|- somedir
|- some.css ; with variable --var1: blue
If you work in some.css and use --var it shows --var1 twice, one with red, one with blue
But this is not wrong, cause CSSVar did not know if some.css is included before index.css.
"Static Solution" with an option eliminate-precedence: it should eleminate --var1 from the file above (if we not work in that folder, depending on current file).
A better non static solution: integrate a callback (include a js method from e.g. .vscode/cssvar.cjs), so that we can set our own custom sort order and priority for included files.
This function needs as parameters a list of all vars und associated filenames and the current working file.
It should return a list with vars & values, that could be used in the current file.
VSCode has started to push CSS Variables into the auto-complete list, when the variables are defined in the same file that a user is working on.
This causes unnecessary duplicates as mentioned here: #66 (comment)
This bug is opened to find if there's any possible way to fix this issue.
I feel there's one way to fix this: do not populate the auto-complete list (with variables from a source file which is what the user is currently working on as well. (This applies to only CSS and similar files)
Just a thought, need to test this, and figure out if this is functional and fixes the issue or not.
The text was updated successfully, but these errors were encountered: