Skip to content
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

Add support for code completion after @debug and @error #186

Closed
wkillerud opened this issue Jul 28, 2024 · 6 comments
Closed

Add support for code completion after @debug and @error #186

wkillerud opened this issue Jul 28, 2024 · 6 comments
Assignees
Labels
enhancement New feature or request

Comments

@wkillerud
Copy link
Owner

wkillerud commented Jul 28, 2024

From #184

I saw that typing on a line with @debug or @error would not show autocomplete suggestions

@use './test' as test;

$message: test. // it will show both suggestions here

@debug test. // it won't show anything here
@error test. // it won't show anything here

It's likely the do-complete feature gets confused by the at-rule statements. See if the completion context can be extended to support code completions in these two scenarios (@debug and @error).

@MenSeb
Copy link
Contributor

MenSeb commented Jul 28, 2024

Thank you for opening this issue.

Just in case I'll add that the at-rule @warn is also a problem.

Another case I found was:

@use './test' as test;

$test: "#{test.}"; // it won't show the autocomplete here after the dot

.#{test.} {} // it won't show the autocomplete here after the dot
// settings.json
{
    "somesass.suggestFunctionsInStringContextAfterSymbols": " (+-*%{"
}

I have a question regarding the option suggestFunctionsInStringContextAfterSymbols which I may not be using correctly. I tried the option by adding { to the default symbols without success. What I was looking for is to trigger the auctocomplete inside a string when using an expression like #{...}.

Please let me know if I'm doing something wrong and/or if you would like me to open another issue about this.

P.S. The example repo has been updated with the new test cases. https://github.com/MenSeb/some-sass-bug

@wkillerud
Copy link
Owner Author

Sounds like a related issue, so we can track it here 👍 There's some handling of string interpolation here, but I guess there are some cases where it doesn't work correctly.

@wkillerud
Copy link
Owner Author

Thanks for testing and reporting so thoroughly 🙌

$test: "#{test.}";

For this case it seems like VS Code is not asking for code suggestions when I type inside the quotes, even after this change, which I believe should make it so VS Code asks for completion items again.

A workaround is to manually ask for suggestions. By default it should be Ctrl + Space.

Another option is to skip the quotes. $test: #{test.} gives suggestions as expected in my testing.

@wkillerud
Copy link
Owner Author

wkillerud commented Jul 29, 2024

Apart from what I mention above, the bugs describe in this issue should be fixed in 3.1.11. I opened a new issue for that, so I'll close this one.

@wkillerud
Copy link
Owner Author

About suggestFunctionsInStringContextAfterSymbols, it's a legacy from scss-intellisense that covers some niche use cases. It's only purpose is to set this flag here in these specific situations.

In your case inside the quotes you end up here, and isInterpolation is true. You do get suggestions if you ask for them manually, so the problem is that VS Code doesn't ask for them for some reason.

@MenSeb
Copy link
Contributor

MenSeb commented Jul 29, 2024

Perfect, thanks for all the information!

I will update the extension, do more testing and get back to you in the new issue if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants