[PATCH] D49523: [clangd] Add support for per-file override compilation command

Marc-Andre Laperle via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jul 18 19:59:32 PDT 2018


malaperle added a comment.

Interesting! We also have a need for passing compilation commands in a context where there is no compile_commands.json, but we were thinking of putting this in a "didChangeConfiguration" message so that all the commands would be available even before files are opened. This would be allow Clangd to have the necessary information for background indexing which would include unopened files. Subsequent changes to compilation commands would probably go through a similar didChangeConfiguration and the appropriate (opened) files would get reparsed (not unlike https://reviews.llvm.org/D49267). I'm making a few guesses here: I assume that in the context of XCode, you would not do background indexing in Clangd but let XCode do it as it can also coordinate (and not overlap) with build tasks. Is that correct? In any case, I think the approach in the patch is not incompatible with what we had in mind, i.e. we could also reuse "overrideCompilationCommandForFile" for each file specified in didChangeConfiguration. I'm point this out because if you *do* end up needing all the compilation commands beforehand like I mentioned, then maybe we can skip the approach of specifying them with didOpen and send them all with didChangeConfiguration from start.


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D49523





More information about the cfe-commits mailing list