vscode-clang icon indicating copy to clipboard operation
vscode-clang copied to clipboard

Use compilation database file if it is present

Open vector-of-bool opened this issue 8 years ago • 6 comments

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.

vector-of-bool avatar May 15 '16 19:05 vector-of-bool

@mitaki28 would love to have this merged.

agauniyal avatar Sep 01 '16 09:09 agauniyal

@mitaki28 Also upvoting. Having support for compilation databases would probably make me switch to vscode

jardon-u avatar Nov 22 '16 16:11 jardon-u

@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?

tanis2000 avatar Feb 24 '17 11:02 tanis2000

Ping for this.

lygstate avatar Apr 10 '17 19:04 lygstate

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 avatar Apr 19 '17 11:04 alighazi

@alighazi last commit was on March 3 but you're free to fork it yourself.

agauniyal avatar Apr 19 '17 12:04 agauniyal