4

I have a directory structure like so

/
| /node
| | index.js
| | /node_modules
| | | /localModule
| | | | index.js
| /node_modules
| | /npmModule

and the problem is I want all node/**/node_modules directories to be indexed and searchable, but due to the default ignoring of node_modules directories, I can't get my wanted node_modules folders included in indexing, is there a way to set a files.include rule the way you can do files.exclude?

2 Answers 2

1

When in settings hover over the line with **/node_modules on it and at the end of the line you can click the little x at the end of the ;line to remove that item from the search.exclude settings. That will result in this setting:

"search.exclude": {
    "**/node_modules": false
},

Alternatively, you can just add the search.exclude entry above to your settings manually with the same effect.

Sign up to request clarification or add additional context in comments.

Comments

-1

At the moment, "files.include" is not supported by the workspace file schema. Vscode says "Unknown configuration setting" when I tried that.

But you can simply add files by defining them under the "folders" directive like this:

{
  "folders": [
    {
      // Source code
      "name": "Product",
      "path": "vscode"
    },
    {
      // Docs and release notes
      "name": "Documentation",
      "path": "vscode-docs"
    },
    {
      // Yeoman extension generator
      "name": "Extension generator",
      "path": "vscode-generator-code"
    }
  ]
}

1 Comment

VS Code gives me "Unknown configuration setting" for this as well

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.