[PATCH] D41668: [clangd] Add static index for the global code completion.

2018-01-10 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. hokein marked an inline comment as done. Closed by commit rCTE322191: [clangd] Add static index for the global code completion. (authored by hokein, committed by ). Changed prior to commit: https://reviews.llvm.org/D41668

[PATCH] D41668: [clangd] Add static index for the global code completion.

2018-01-10 Thread Haojian Wu via Phabricator via cfe-commits
hokein marked an inline comment as done. hokein added inline comments. Comment at: clangd/CodeComplete.cpp:661 + if (CompletedName.SSInfo) { +// For a namespace scope specifier ("ns::"), we have disabled Sema from +// collecting completion results by setting IncludeNames

[PATCH] D41668: [clangd] Add static index for the global code completion.

2018-01-10 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 129272. hokein added a comment. Remove the temporary fix. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D41668 Files: clangd/ClangdLSPServer.cpp clangd/ClangdLSPServer.h clangd/ClangdServer.cpp clangd/ClangdServer.h clangd/CodeComp

[PATCH] D41668: [clangd] Add static index for the global code completion.

2018-01-10 Thread Sam McCall via Phabricator via cfe-commits
sammccall added inline comments. Comment at: clangd/CodeComplete.cpp:661 + if (CompletedName.SSInfo) { +// For a namespace scope specifier ("ns::"), we have disabled Sema from +// collecting completion results by setting IncludeNamespaceLevelDecls to I d

[PATCH] D41668: [clangd] Add static index for the global code completion.

2018-01-10 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 129265. hokein added a comment. - Update comment - Only use Sema results if the scope specifier (`ns::^`) is not a namespace scope specifier. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D41668 Files: clangd/ClangdLSPServer.cpp clangd/

[PATCH] D41668: [clangd] Add static index for the global code completion.

2018-01-10 Thread Sam McCall via Phabricator via cfe-commits
sammccall accepted this revision. sammccall added a comment. Nice! LG Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D41668 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-co

[PATCH] D41668: [clangd] Add static index for the global code completion.

2018-01-10 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 129245. hokein marked 3 inline comments as done. hokein added a comment. - make static index independent with dynamic index - don't clear results from clang's completion engine as we also intend to merge them into the final results eventually. Repository:

[PATCH] D41668: [clangd] Add static index for the global code completion.

2018-01-09 Thread Sam McCall via Phabricator via cfe-commits
sammccall accepted this revision. sammccall added a comment. Ilya's suggestion to have a single index on the CodeCompleteOptions that encapsulates the merging seems reasonable to me, but not urgent. So let's get this in as-is and we can make that change whenever. Comment at: c

[PATCH] D41668: [clangd] Add static index for the global code completion.

2018-01-09 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 129081. hokein marked 4 inline comments as done. hokein added a comment. Address review comments. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D41668 Files: clangd/ClangdLSPServer.cpp clangd/ClangdLSPServer.h clangd/ClangdServer.cpp

[PATCH] D41668: [clangd] Add static index for the global code completion.

2018-01-09 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added inline comments. Comment at: clangd/ClangdLSPServer.h:40 + bool BuildDynamicSymbolIndex, + std::unique_ptr StaticIdx); sammccall wrote: > is there a reason ClangdServer should own this? I can imagine this >

[PATCH] D41668: [clangd] Add static index for the global code completion.

2018-01-09 Thread Sam McCall via Phabricator via cfe-commits
sammccall added inline comments. Comment at: clangd/ClangdLSPServer.h:40 + bool BuildDynamicSymbolIndex, + std::unique_ptr StaticIdx); is there a reason ClangdServer should own this? I can imagine this complicating life for em

[PATCH] D41668: [clangd] Add static index for the global code completion.

2018-01-09 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 129047. hokein marked 2 inline comments as done. hokein added a comment. Fix remaining comments. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D41668 Files: clangd/ClangdLSPServer.cpp clangd/ClangdLSPServer.h clangd/ClangdServer.cpp

[PATCH] D41668: [clangd] Add static index for the global code completion.

2018-01-05 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 Comment at: clangd/CodeComplete.cpp:554 + const SpecifiedScope &SSInfo, + llvm::StringRef IndexSource

[PATCH] D41668: [clangd] Add static index for the global code completion.

2018-01-05 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clangd/ClangdServer.h:342 std::unique_ptr FileIdx; + /// If set, this provides static index for project-wide global symbols. + std::unique_ptr StaticIdx; ioeric wrote: > ... in addition to the `FileIdx` above? Update

[PATCH] D41668: [clangd] Add static index for the global code completion.

2018-01-05 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 128741. hokein marked 5 inline comments as done. hokein added a comment. Address comments. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D41668 Files: clangd/ClangdLSPServer.cpp clangd/ClangdLSPServer.h clangd/ClangdServer.cpp clangd

[PATCH] D41668: [clangd] Add static index for the global code completion.

2018-01-05 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: clangd/ClangdServer.h:208 bool BuildDynamicSymbolIndex = false, + std::unique_ptr StaticIdx = nullptr, llvm::Optional ResourceDir = llvm::None); Please also add comment for th

[PATCH] D41668: [clangd] Add static index for the global code completion.

2018-01-04 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 128604. hokein added a comment. Update Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D41668 Files: clangd/ClangdLSPServer.cpp clangd/ClangdLSPServer.h clangd/ClangdServer.cpp clangd/ClangdServer.h clangd/CodeComplete.cpp clangd/C

[PATCH] D41668: [clangd] Add static index for the global code completion.

2018-01-04 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 128603. hokein marked an inline comment as done. hokein added a comment. Add index source information to the completion item. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D41668 Files: clangd/ClangdLSPServer.cpp clangd/ClangdLSPServer.h

[PATCH] D41668: [clangd] Add static index for the global code completion.

2018-01-03 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: clangd/CodeComplete.cpp:583 - Items->isIncomplete = !Index.fuzzyFind(Ctx, Req, [&](const Symbol &Sym) { -Items->items.push_back(indexCompletionItem(Sym, Filter, SSInfo)); - }); + // FIXME: figure out a way to merge the symbols fr

[PATCH] D41668: [clangd] Add static index for the global code completion.

2018-01-03 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. Thanks for the comments. Comment at: clangd/ClangdLSPServer.h:40 + bool BuildDynamicSymbolIndex, + std::unique_ptr GlobalIdx); ioeric wrote: > We are calling this global index and static index in the p

[PATCH] D41668: [clangd] Add static index for the global code completion.

2018-01-03 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 128513. hokein marked 8 inline comments as done. hokein added a comment. Address review comments. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D41668 Files: clangd/ClangdLSPServer.cpp clangd/ClangdLSPServer.h clangd/ClangdServer.cpp

[PATCH] D41668: [clangd] Add static index for the global code completion.

2018-01-03 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added inline comments. Comment at: clangd/tool/ClangdMain.cpp:122 +llvm::cl::desc( +"YAML-format global symbol file to build the static index. It is only " +"available when 'enable-index-based-completion' is enabled."), Let's als

[PATCH] D41668: [clangd] Add static index for the global code completion.

2018-01-03 Thread Eric Liu via Phabricator via cfe-commits
ioeric added a comment. You have mentioned that YAML data source is experimental only in the patch summary, but we should also mention this in the code. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D41668 ___ cfe-commits mailing

[PATCH] D41668: [clangd] Add static index for the global code completion.

2018-01-03 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: clangd/ClangdLSPServer.h:40 + bool BuildDynamicSymbolIndex, + std::unique_ptr GlobalIdx); We are calling this global index and static index in the patch. I think we should be consisten

[PATCH] D41668: [clangd] Add static index for the global code completion.

2018-01-02 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added reviewers: sammccall, ioeric. Herald added subscribers: ilya-biryukov, klimek. Use the YAML-format symbols (generated by the global-symbol-builder tool) to do the global code completion. It is **experimental** only , but it allows us to experience global