How can I find out why IntelliSense includes a specific path in the file discovery? #13774
-
The problem I have with IntelliSense is that for a large software project it uses extreme amounts of memory after a while, until the whole computer becomes unresponsive. The only solution is to kill the problematic The problem probably is caused by the fact that IntelliSense decides to index all the files under a common root directory. There are lots of source directories in different Git repositories. But in the collection of folders that I have opened in a specific VS Code workspace this common root directory is not opened as a folder. Only several selected sub-folders of the common root directory are in the workspace. How can I find out why IntelliSense decides to include the problematic common root folder in the "Processing folder (recursive):" list in the C/C++ debug output? It is possible that there's a bug that this directory is referenced unintentionally from one of our CMakeLists.txt files for example, but we were not able to locate this yet. I have checked for example the |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Here’s a practical way to track down why that outside folder is being indexed and how to stop it. How to see where the path comes from
Ways to prevent that root from being indexedOption A — Exclude it explicitly (quickest): add to your workspace settings:
Option B — Pin
Option C — If you use CMake Tools as a provider:
In your CMake, replace broad:
with target-scoped:
Option D — Tame recursive includes (newer setting):
Clean up & verify
If this helped, please consider marking the answer as Accepted so others can find it faster. |
Beta Was this translation helpful? Give feedback.
-
I only saw now that you wrote such a detailed troubleshooting guide, thanks a lot! At the moment the problem does not happen for some reason, but when it reappears I will use your guide. |
Beta Was this translation helpful? Give feedback.
Here’s a practical way to track down why that outside folder is being indexed and how to stop it.
How to see where the path comes from
Run “C/C++: Log Diagnostics” on one of the affected source files.
In the output, check:
ms-vscode.cmake-tools
)Open OUTPUT → “C/C++” and set
Then watch for lines like “Processing folder (recursive): /some/path”.
That’s usually coming from
browse.path
(often expanded from a/**
pattern), a provider (CMake Tools), or an include directory pulled fromcompile_commands.json
.Search for the offend…