pucelle / vscode-css-navigation

Allowing Go to definition from HTML to CSS, or Find References from CSS to HTML.
https://marketplace.visualstudio.com/items?itemName=pucelle.vscode-css-navigation
MIT License
64 stars 8 forks source link

`node_modules` folder is not excluded #36

Closed gremo closed 3 years ago

gremo commented 4 years ago

Clean installation, as you can see node_modules folder is not excluded. Is this a bug?

Cattura

pucelle commented 4 years ago

Can you share your HTML & CSS codes? Currently it works like this: It doesn't included node_modules by default, but if your HTML or CSS files explicitly import css files from node_modules, it will be included, so you can find definitions even for codes in the node_modules.

May be we can make it works better, like not include node_modules only for the global symbol searching? Never mind to give your idea.

gremo commented 4 years ago

Hi @pucelle, sure. I included (actually imported in my main.scss) bootstrap main SCSS file from node_modules. So you confirm that even if node_modules is excluded, it's the default behaviour to get auto-complete from that folder?

I really don't know if this can help, but the idea (for me) to get this extension to work was:

This because main.css will already include all necessary css/scss from node_modules.

pucelle commented 4 years ago

Hi,

  1. navigating to .scss is the main functionality of this plugin, but you can set the file types to included with setting activeCSSFileExtensions, just refer to https://github.com/pucelle/vscode-css-navigation#configuration
  2. In fact it works just like what you want before, until some people told me they really need to navigate into the codes in the node_modules. So I guess I would design a new configuration to handle it.
  3. as 1 said. If you willing is to only include one file, it's not possible to do so, what we can do is to include one type of files.
pucelle commented 3 years ago

I added a new option alwaysIncludeImportedFiles, you can set it to false to ignore all the things in node_modules.