Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS Code Go to Symbol in Workspace - exclude external files

Using VSCode is there a way to configure the Go to Symbol in Workspace tool (default ctrl+T) to exclude external directories?

In my Angular workspace, VS Code is currently listing symbols in node_modules, program files and other directories I am not interested in searching.

enter image description here

Researching around the internet I various posts recommended trying the following settings, but setting these did not impact Go to Symbols.

.vscode\settings.json

    "files.exclude": {
        "**/node_modules": true,
        "**/obj": true,
        "*.d.ts": true
    },
    "search.exclude": {
        "**/node_modules": true,
        "**/dist": true,
        "*.d.ts": true
    },

\jsconfig.json

   "compilerOptions": {
        "target": "ES6",
        "lib": []
    },
    "exclude": [
        "node_modules",
        "**/node_modules/*"
    ]
like image 365
Philip Pittle Avatar asked Aug 31 '25 04:08

Philip Pittle


1 Answers

Try this:

  1. Go to: File > Preferences > Settings
  2. Type in the search field: exclude
  3. Add the following under "Files: Exclude": **/node_modules
  4. And add the following under "Files: Watcher Exclude": **/node_modules/*/**

enter image description here

I hope this is what you are looking for (which works for me)

like image 87
Kajen Avatar answered Sep 02 '25 16:09

Kajen