-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Intellisense option to parse all files of the project on startup in background #8935
Comments
The extension's browse engine does tag parsing of all files in a project on startup to index symbols in a browse or symbol database. The files the extension parses can be seen in the Language Server logging (see https://code.visualstudio.com/docs/cpp/enable-logging-cpp#_enable-logging-for-the-language-server). To clarify, is this new "IntelliSense option to parse all files" feature something different from the existing browse engine tag parsing? That is, would this new feature have IntelliSense engine compile the entire project on startup? |
When I open a file, the fire icon at the bottom shows that some parsing is ongoing. |
@sean-mcmanus could you comment on this one? I see there was a discussion related to this at #8881. |
@michelleangela |
The fire icon (IntelliSense parsing) is required when a document is opened -- it's parsing the TU, which isn't fully stored to disk. If you have C_Cpp.intelliSenseCacheSize > 0 then we do some caching of the header file contents in ipch files. Additional caching with manual pch is being tracked by #3628 , which could yield additional speedup. We could potentially generate ipch files in the background, but I'm not convinced that the cost would outweigh the benefit. The tag parsing to generate global symbols, document symbols, and go to definition targets is already done in the background and saved to our database. However, an ongoing IntelliSense operation could block that database request from giving results sooner. |
@sean-mcmanus |
I think it auto create index for files in the project, but not for dependencies that lives out side of the project folder. So you can't search for your dependencies (although they are in the compile_commands.json file). BTW, Clion creates index for these dependencies. |
This is the closest I could see to what I was looking for so weighing in here. If I set:
And watch the contents with something like:
I can see the files getting indexed as they're opened. As a new user to vscode this did surprise me purely because there is a little spinner in the corner that's easy to miss (certainly on an ultrawide monitor :)) letting me know that indexing was happening. The time to index each file in my project about 10-20 seconds. As someone trying out this functionality for the first time, I had assumed that this had in fact not worked at all when instead I was simply "impatient". Also I think databaseFilename was originally blank so it was doing this all the time so I assumed intellisense was simply not working correctly. An option (even a Command Palette command rather than a mandatory slow startup command) to index all actual project files in the workspace would be brilliant. |
@fquinner The browse.database property only affects the db file and it should default to |
This issue has been closed because it needs more information and has not had recent activity. |
When the IDE CLion starts, it parses all documents once and probably creates some kind of cached index.
This means that when you open a file, all symbols and go to definition calls are more or less done in an instant.
Would it be possible to add some kind of option for this to happen in VSC?
Specifically, add an option for Intellisense to parse not only opened files on the fly, but parse all files(on the basis of e.g. compile_commands.json) after vsc startup.
For big projects I would rather wait longer after startup, than to wait a little each time I open a file before Intellisense updates.
The text was updated successfully, but these errors were encountered: