I've started to get errors Unable to open 'header.h': File not found
when I try to jump to var/func definition via [Ctrl+Click] after I've deleted/renamed several files.
Is it possible to force reindex source code?
I've started to get errors Unable to open 'header.h': File not found
when I try to jump to var/func definition via [Ctrl+Click] after I've deleted/renamed several files.
Is it possible to force reindex source code?
This question is a few years old now, but this is an issue I've seen a lot, and can usually be fixed with one of the following 5 options:
You can reload the current session, with the workbench.action.reloadWindow
command:
Open the Command Palette with Ctrl + Shift + P Then type
Reload Window
For C/C++ projects specificially, sometimes the intellisense indexing can be really slow, and feel like it's not working. One solution for this is to limit what it indexes with something like limitSymbolsToIncludedHeaders
, or reduce the amount of parsed files in c_cpp_properties.json
"browse": {
"path": [
"/usr/include/",
"/usr/local/include/",
"${workspaceRoot}/../include",
"${workspaceRoot}/dir2",
"${workspaceRoot}/dir3/src/c++"
...
]
}
Sometimes the file associations are incorrect, so files are not indexed as expected.
This can be fixed by adding something similar to this into your VS Code settings (settings.json
):
"intelephense.files.associations": ["*.php", "*.phtml", "*.inc", "*.module", "*.install", "*.theme", ".engine", ".profile", ".info", ".test"]
For Windows users, VS Code uses the system search index, so rebuilding that may help.
Finally, it may seem obvious, but just confirm that Intellisense is actually enabled, with editor.tabCompletion
in your settings.json. And if you're searching with results not displaying, ensure there aren't any filters preventing results.