vscode-clang
vscode-clang copied to clipboard
Use compilation database file if it is present
This change makes it such that the completion and diagnostic provider read more clang compile flags from a compilation database if it is available. A few notes:
- The database is reloaded when changes are detected, and the settings therein are stored in memory to keep latency low when performing completions.
- Options are prepended to the
clang.*flags
settings. - Because headers don't have an entry in the database, the loader performs path normalization/stemming to produce a "best guess" at what the flags for processing a header should be: usually it will use the flags of the header's corresponding source file.
- Flags are filtered and pre-processed to be compatible with the
clang -cc1 -fsyntax-only
mode. Only relevant flags from the database are used.
@mitaki28 would love to have this merged.
@mitaki28 Also upvoting. Having support for compilation databases would probably make me switch to vscode
@vector-of-bool I've tried using your branch and it works as class names are being recognized now, but for some reason the properties and methods of those classes aren't being found for autocompletion. Do you have any clue why that's happening?
Ping for this.
this repo is no longer maintained by it author. it would be nice if someone create a new fork and a vscode package based on this pull request so everyone can use it easily
@alighazi last commit was on March 3 but you're free to fork it yourself.