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

scss: ctrl+click on import from node_modules not working on nested folders #316

Open
lucas-labs opened this issue Nov 16, 2022 · 0 comments

Comments

@lucas-labs
Copy link

lucas-labs commented Nov 16, 2022

Ctrl/cmd+Click links to node_modules on imports/use only works in .scss files located at the same level as the node_modules folder, but it doesn't work if the scss is inside a nested folder. Consider this scenario:

project
├── node_modules
│   └── @scope
│       └── lib
│           └── index.scss
│  
│  
├── here-it-works.scss   <---- at project root, when node_modules is located in the same folder
│                              as the file, Ctrl+click will work 
│              
└── folder
    └── here-it-doesnt.scss  <-- one level deeper into the folder structure, it doesn't work anymore :(
// /here-it-works.scss

@use "@scope/lib"; // Ctrl+Click here will redirect you to node_modules/@scope/lib/index.scss
// /folder/here-it-doesnt-work.scss

@use "@scope/lib"; // Ctrl+Click will try to locate a file called
                   // "lib" in /folder/@scope/lib instead of 
                   // looking into root-level node_modules

A screenrecored gif to further explain what I'm talking about (this was recorded on a clean vscode instance, without any extensions installed, by runing it with the --profile-temp flag):

vscode-scss-issue

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

No branches or pull requests

1 participant