[PATCH] D50847: [clangd] Add callbacks on parsed AST in addition to parsed preambles

2018-08-16 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov created this revision. ilya-biryukov added a reviewer: hokein. Herald added subscribers: arphaman, jkorous, MaskRay, ioeric, javed.absar. Will be used for updating the dynamic index on updates to the open files. Currently we collect only information coming from the preamble AST. This

[PATCH] D50847: [clangd] Add callbacks on parsed AST in addition to parsed preambles

2018-08-16 Thread Eric Liu via Phabricator via cfe-commits
ioeric added a comment. > Dynamic index misses important information from the body of the file, e.g. > locations of definitions > XRefs cannot be collected at all, since we can only obtain full information > for the current file (preamble is parsed with skipped function bodies, > therefore not

[PATCH] D50847: [clangd] Add callbacks on parsed AST in addition to parsed preambles

2018-08-17 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added a comment. In https://reviews.llvm.org/D50847#1202658, @ioeric wrote: > > Dynamic index misses important information from the body of the file, e.g. > > locations of definitions > > XRefs cannot be collected at all, since we can only obtain full > > information for the curr

[PATCH] D50847: [clangd] Add callbacks on parsed AST in addition to parsed preambles

2018-08-17 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added a comment. @ioeric, specifically, see https://reviews.llvm.org/D50889 for an updated FileIndex Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D50847 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://

[PATCH] D50847: [clangd] Add callbacks on parsed AST in addition to parsed preambles

2018-08-17 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. Thanks for adding it. Comment at: clangd/TUScheduler.cpp:406 // We only need to build the AST if diagnostics were requested. if (WantDiags == WantDiagnostics::No) return; The AST might not get built if `WantDiags::No`, a

[PATCH] D50847: [clangd] Add callbacks on parsed AST in addition to parsed preambles

2018-08-17 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added inline comments. Comment at: clangd/TUScheduler.cpp:406 // We only need to build the AST if diagnostics were requested. if (WantDiags == WantDiagnostics::No) return; hokein wrote: > The AST might not get built if `WantDiags::N

[PATCH] D50847: [clangd] Add callbacks on parsed AST in addition to parsed preambles

2018-08-20 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Herald added a subscriber: kadircet. Comment at: clangd/TUScheduler.h:66 + /// instead. + virtual void onMainAST(PathRef Path, ParsedAST &AST) = 0; +}; ilya-biryukov wrote: > hokein wrote: > > Does the callback get called every tim

[PATCH] D50847: [clangd] Add callbacks on parsed AST in addition to parsed preambles

2018-08-20 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. The interfaces look mostly good to me. Comment at: clangd/ClangdServer.cpp:73 + + void onPreambleAST(PathRef Path, ASTContext &Ctx, + std::shared_ptr PP) override { I think `Ctx` should be a `pointer` which gives us

[PATCH] D50847: [clangd] Add callbacks on parsed AST in addition to parsed preambles

2018-08-21 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov updated this revision to Diff 161717. ilya-biryukov added a comment. - Provide noop callbacks implementation by default. - Update docs. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D50847 Files: clangd/ClangdServer.cpp clangd/ClangdServer.h clangd/TUSchedul

[PATCH] D50847: [clangd] Add callbacks on parsed AST in addition to parsed preambles

2018-08-21 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added inline comments. Comment at: clangd/ClangdServer.cpp:73 + + void onPreambleAST(PathRef Path, ASTContext &Ctx, + std::shared_ptr PP) override { hokein wrote: > I think `Ctx` should be a `pointer` which gives us a way (passi

[PATCH] D50847: [clangd] Add callbacks on parsed AST in addition to parsed preambles

2018-08-22 Thread Haojian Wu via Phabricator via cfe-commits
hokein accepted this revision. hokein added a comment. This revision is now accepted and ready to land. Thanks! Looks good. Comment at: clangd/ClangdServer.cpp:73 + + void onPreambleAST(PathRef Path, ASTContext &Ctx, + std::shared_ptr PP) override { ---

[PATCH] D50847: [clangd] Add callbacks on parsed AST in addition to parsed preambles

2018-08-22 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added inline comments. Comment at: clangd/ClangdServer.cpp:73 + + void onPreambleAST(PathRef Path, ASTContext &Ctx, + std::shared_ptr PP) override { hokein wrote: > ilya-biryukov wrote: > > hokein wrote: > > > I think `Ctx` shou

[PATCH] D50847: [clangd] Add callbacks on parsed AST in addition to parsed preambles

2018-08-22 Thread Phabricator via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL340401: [clangd] Add callbacks on parsed AST in addition to parsed preambles (authored by ibiryukov, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit: https://reviews.llv