ilya-biryukov added inline comments.
================ Comment at: clangd/ClangdUnit.cpp:103 + void AfterExecute(CompilerInstance &CI) override { + const SourceManager &SM = CI.getSourceManager(); ---------------- Nebiroth wrote: > ilya-biryukov wrote: > > There's a much better public API to get all includes that were encountered > > by the `Preprocessor`: we need to override `PPCallbacks > > ::InclusionDirective`. > > > > > > `PrecompiledPreamble` does not currently expose this callbacks, but could > > you add to `PreambleCallbacks` in a separate commit? > > > If I were to use InclusionDirective , how would that callback be called > automatically? As far as I know, it wouldn't be called automatically for > every file that gets indexed the same way AfterExecute would be. It will be called for each `#include` directive that Preprocessor encountered while building the preamble. A separate instance of `CppFilePreambleCallbacks` is created every time we build a preamble for file. Does that answer your question? https://reviews.llvm.org/D38639 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits