-
Notifications
You must be signed in to change notification settings - Fork 29.4k
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
SCSS follow link resolves wrong path (prefixes base with underscore) #58204
Comments
(Experimental duplicate detection) |
I'm guessing the file you are working on is located at |
correct
|
I see, in SCSS you don't have to put an underscore before the filename for it to not compile... |
I can't say for every scss compiler tool. maybe some has this convention and act upon it by default. I use |
This error also happens when you leave out the file type. Example: @import "card"; // Fails
@import "_card"; // Fails
@import "card.scss"; // Fails
@import "_card.scss"; // Works @octref & @Spown the underscore is purely for scss files that are imported via an scss file. |
I see. And during my testing, unless you specifically specify |
@aeschli Do you have any suggestions as to how to do this in service?
|
I personally don't understand why the service even needs to guess anything. Follow link is being supplied an definite path from the file source. |
@Spown The service is used in Monaco too, which can be used in browser that doesn't have file system access: https://microsoft.github.io/monaco-editor/playground.html. |
@octref we could add something like a file system provider that we initialise the service with. |
Moving to October since introducing a FS Provider to the Language Service is more work. |
Same problem for me, I have a master.scss that only does multiples
Is there any way to make it just go to what is written, just follow the path in any case ? |
Another simple problem in VSCode that is not fixed by the team. |
Which is normal since it is by no mean part of SASS specifications. |
Is there an alternative extension available? This makes Visual Code useless for frontend developers. |
that seems like a stretch. VSCode is by no means useless for frontend developers with this bug. Lets try to keep the hyperbole down to a believable level. Is the bug annoying? yes. Can it be worked around? also yes. I would be awesome if this were fixed, though, as it is a major annoyance at the very least. |
Also important one is to fix "~" as a node_modules shortcut, it doesn't resolve paths like |
In case anybody is looking to implement, here's the spec for resolving @imports in sass: https://github.com/sass/sass/blob/master/spec/at-rules/import.md |
microsoft/vscode-css-languageservice#159 should fix the inconsistency where It doesn't solve the underlying problem of VScode assuming the convention of "Sass files that are only meant to be imported, not compiled on their own, begin with _ (as in _code.scss)" rather than following the import spec but at least it makes that behaviour more consistent. |
I'll fix this with a dynamic resolver. Previously there's no Here's my plan:
|
Is "a could resolve to either a.scss, _a.scss or a/index.scss or a/_index.scss (dynamic link)" part of SASS specifications? |
I still can't get SCSS referencing to work after the update. It's true that it no longer requires an underscore in front of the filename, but absolute imports only work if prepended by a slash, however that tends not to compile with webpack's |
@kasvtv Please post new issues with full reproducible steps. |
@kasvtv then it's an issue with
|
Steps to Reproduce:
Does this issue occur when all extensions are disabled?: Yes
Insiders?: Yes
The text was updated successfully, but these errors were encountered: