[PATCH] D50889: [clangd] Make FileIndex aware of the main file

2018-08-22 Thread Phabricator via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rCTE340404: [clangd] Make FileIndex aware of the main file (authored by ibiryukov, committed by ). Changed prior to commit: https://reviews.llvm.org/D50889?vs=161924&id=161930#toc Repository: rCTE Clan

[PATCH] D50889: [clangd] Make FileIndex aware of the main file

2018-08-22 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov updated this revision to Diff 161924. ilya-biryukov added a comment. - Rebase onto head Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D50889 Files: clangd/ClangdServer.cpp clangd/ClangdServer.h clangd/index/FileIndex.cpp clangd/index/FileIndex.h Index: cl

[PATCH] D50889: [clangd] Make FileIndex aware of the main file

2018-08-22 Thread Eric Liu via Phabricator via cfe-commits
ioeric accepted this revision. ioeric added a comment. This revision is now accepted and ready to land. lgtm Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D50889 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.l

[PATCH] D50889: [clangd] Make FileIndex aware of the main file

2018-08-21 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov marked an inline comment as done. ilya-biryukov added inline comments. Comment at: clangd/index/FileIndex.h:70 + void + update(PathRef Path, ASTContext *AST, std::shared_ptr PP, + llvm::Optional> TopLevelDecls = llvm::None); hokein wrote:

[PATCH] D50889: [clangd] Make FileIndex aware of the main file

2018-08-21 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov marked 2 inline comments as done. ilya-biryukov added a comment. All the issues should be addressed at this point Comment at: clangd/ClangdServer.cpp:70 +// FIXME(ibiryukov): this should be a generic helper instead. +class NoopCallbacks : public ParsingCallbacks {

[PATCH] D50889: [clangd] Make FileIndex aware of the main file

2018-08-21 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov updated this revision to Diff 161718. ilya-biryukov added a comment. - Use noop callbacks from the parent revision Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D50889 Files: clangd/ClangdServer.cpp clangd/ClangdServer.h clangd/index/FileIndex.cpp clangd/i

[PATCH] D50889: [clangd] Make FileIndex aware of the main file

2018-08-21 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added inline comments. Comment at: clangd/ClangdServer.cpp:70 +// FIXME(ibiryukov): this should be a generic helper instead. +class NoopCallbacks : public ParsingCallbacks { public: ioeric wrote: > Maybe provide noop implementations for `ParsingCal

[PATCH] D50889: [clangd] Make FileIndex aware of the main file

2018-08-21 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov updated this revision to Diff 161694. ilya-biryukov marked 3 inline comments as done. ilya-biryukov added a comment. - Move DynamicIndex into ClangdServer.cpp - Rename FileIdx to DynamicIdx - Avoid modifying input args Repository: rCTE Clang Tools Extra https://reviews.llvm.org/

[PATCH] D50889: [clangd] Make FileIndex aware of the main file

2018-08-20 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: clangd/ClangdServer.cpp:70 +// FIXME(ibiryukov): this should be a generic helper instead. +class NoopCallbacks : public ParsingCallbacks { public: Maybe provide noop implementations for `ParsingCallbacks::onPreambleAST()

[PATCH] D50889: [clangd] Make FileIndex aware of the main file

2018-08-20 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Herald added a subscriber: kadircet. Comment at: clangd/index/FileIndex.h:70 + void + update(PathRef Path, ASTContext *AST, std::shared_ptr PP, + llvm::Optional> TopLevelDecls = llvm::None); Any strong reason to unify the i

[PATCH] D50889: [clangd] Make FileIndex aware of the main file

2018-08-17 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added a comment. Still missing tests, but otherwise should be good to review. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D50889 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/m

[PATCH] D50889: [clangd] Make FileIndex aware of the main file

2018-08-17 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov updated this revision to Diff 161260. ilya-biryukov added a comment. - Reverted changes to FileIndex, use merged index instead Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D50889 Files: clangd/ClangdServer.cpp clangd/ClangdServer.h clangd/index/FileIndex.cp

[PATCH] D50889: [clangd] Make FileIndex aware of the main file

2018-08-17 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov planned changes to this revision. ilya-biryukov added a comment. As discussed offline, we could instead have a two-layer scheme for dynamic index. A top layer will contain main file symbols, second layer will contain preamble symbols. Repository: rCTE Clang Tools Extra https:/

[PATCH] D50889: [clangd] Make FileIndex aware of the main file

2018-08-17 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added a comment. This is still WIP, but wanted to share anyway the progress anyway. Need to fix the FIXMEs currently added to the code and add tests. Comment at: clangd/index/FileIndex.cpp:81 if (!Slab) FileToSlabs.erase(Path); else We

[PATCH] D50889: [clangd] Make FileIndex aware of the main file

2018-08-17 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov created this revision. ilya-biryukov added reviewers: hokein, ioeric. Herald added subscribers: arphaman, jkorous, MaskRay. It was previously only indexing the preamble decls. The new implementation will index both the preamble and the main AST and report both sets of symbols, prefer