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

@use with pkg: report an error and break the extension #184

Closed
MenSeb opened this issue Jul 27, 2024 · 3 comments · Fixed by #185
Closed

@use with pkg: report an error and break the extension #184

MenSeb opened this issue Jul 27, 2024 · 3 comments · Fixed by #185

Comments

@MenSeb
Copy link
Contributor

MenSeb commented Jul 27, 2024

Hi,

Thanks a lot for this extension, I find it very useful when working with SASS files!

I found 2 issues/PRs that seem to have fixed the problem, it might be an error on my side...

  • VS Code version: 1.91.1
  • Extension version: 3.1.8
  • Operating system: Windows

Reproducible Case:

https://github.com/MenSeb/some-sass-bug

Requirements:

Install and activate the Some Sass extension.

run:

npm install

Steps to Reproduce:

  1. Open the Some Sass output in VSCode
  2. Open the index.scss file in the repo
  3. Look at the output error
  4. You can also trigger the error by commenting and uncommenting the line:
@use 'pkg:sass-true' as *;

The error:

[Error - 7:29:00 PM] Request textDocument/documentLink failed.
  Message: Request textDocument/documentLink failed with message: Cannot read properties of undefined (reading 'sass')
  Code: -32603

Nothing works after that, for example, I am no longer able to see the autocomplete suggestion from my other imported module test.scss using @use and I can't see any information on hover.

// src/index.scss

@use 'pkg:sass-true' as *;
@use './test' as test;

$message: test.hello();

@debug $message;
// src/test.scss

@function hello($name: 'World') {
    @return 'Hello #{$name}!';
}

When creating this minimal repo example, I saw that typing on a line with @debug or @error would not show autocomplete suggestions, is this normal?

// src/index.scss

@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
@wkillerud
Copy link
Owner

wkillerud commented Jul 28, 2024

Thanks so much for providing a reproducible case 🙌 Looks like a case I haven't handled in how a package can declare its exports. A fix for that is on the way.

You're right that completions don't work as expected after a @debug or @error statement. That might need more work to support. I'll open up a separate issue for that.

@wkillerud
Copy link
Owner

The crash is fixed in 3.1.9. I opened #186 to look into the code completions.

@MenSeb
Copy link
Contributor Author

MenSeb commented Jul 28, 2024

Thank you very much, it works like a charm now!

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

Successfully merging a pull request may close this issue.

2 participants