-
-
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
Code suggestions in interpolations in a quoted string don't come automatically #190
Comments
As mentioned in #186 (comment), there are workarounds:
|
Ok, I can confirm that without the quotes it shows suggestions and with quotes using I may have found something else related to this issue/bug. If I want to include a mixin from another file with the @use './test' as test;
@include test. // shows the existing mixins But if I want to use a function or variable in a mixin from an // _test.scss
@function name() {
@return 'Some Sass';
} // _index.scss
@use './test' as test;
// works correctly here, but it only shows existing mixins
// it should show the variable $name and the function name()
@include test.hello(test.name()); This conflict seems to be related to the fact that it only expects mixin since the line includes a // _index.scss
// work with the ctrl + space, but it shows everything, even mixins?
$test: "#{test.hello()}";
// works correctly here, but it shows everything, even mixins?
#{test.selector()} {
width: 100%;
} The repository is up to date with all of this. |
Thanks @MenSeb, the bug of variables and functions not being suggested as mixin parameters is fixed in 3.3.0.
I don't see mixins in my code suggestions there. There are two suggestions for |
Thanks @wkillerud it works perfectly!
My apologies, I may have confused functions with mixins at that moment, I can't reproduce what I pointed out. |
I may have something else to add, I don't think it as a bug, but rather a feature that could be implemented. It is related to code suggestion, would you rather have a new issue for that or should I continue here? (I am updating the repo right now) It does behave differently in some situation, I don't know if it is related to the extension tho. The suggestions won't show what was forwarded from a sass package. // _sass.scss
@use 'sass:meta';
@function is-number($value) {
@return meta.type-of($value) == number;
} // _test.scss
@forward 'pkg:sass-true';
@forward 'sass:meta';
@forward './sass'; // index.scss
@use './test' as test;
// The custom logic is forwarded and shows suggestions
@debug test.is-number(10);
// The package pkg:sass-true is forwarded and shows suggestions
@debug test.$catch-errors;
// The package sass:meta is forwarded but it won't shows suggestions
@debug test.type-of('string'); The repo is up to date, please let me know if you wish to open a new issue for that. |
Interesting, I hadn't considered that case 😄 The completions for sass built-ins get added here, but only if they are some-sass/packages/language-services/src/features/do-complete.ts Lines 608 to 624 in 5f29b4e
I'll take a look at adding support for No need for a new issue this time, but if you find something else it would be great if you opened a new issue – easier for me to keep track that way 👍 Edit: fixed in 3.4.0 |
I came up with this case while trying to forward "enhanced" sass modules with more utilities added to them haha It works like a charm, thank you so much for your time and development :) |
About VS Code
Version: 1.91.1 (Universal)
Commit: f1e16e1e6214d7c44d078b1f0607b2388f29d729
Date: 2024-07-09T22:07:54.982Z
Electron: 29.4.0
ElectronBuildId: 9728852
Chromium: 122.0.6261.156
Node.js: 20.9.0
V8: 12.2.281.27-electron.0
OS: Darwin arm64 23.5.0
Reproducible Case: MenSeb/some-sass-bug@48d7175
Steps to Reproduce:
index.scss
$test: "#{test.hello()}"
) the interpolation should show code completions once you finish typing"#{
.Investigating in #186, it seems like VS Code does not send
onCompletion
requests even if we last responded withisIncomplete = true
set on the result.The text was updated successfully, but these errors were encountered: