[PATCH] D41281: [clangd] Index-based code completion.

2017-12-19 Thread Eric Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL321083: [clangd] Index-based code completion. (authored by ioeric, committed by ). Repository: rL LLVM https://reviews.llvm.org/D41281 Files: clang-tools-extra/trunk/clangd/CodeComplete.cpp clang-

[PATCH] D41281: [clangd] Index-based code completion.

2017-12-19 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: clangd/CodeComplete.h:64 + + // Populated internally by clangd, do not set. + /// If `Index` is set, it is used to augment the code completion ilya-biryukov wrote: > sammccall wrote: > > ilya-biryukov wrote: > > > ioeri

[PATCH] D41281: [clangd] Index-based code completion.

2017-12-19 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 127538. ioeric added a comment. - Add a FIXME for Index in code completion options. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D41281 Files: clangd/CodeComplete.cpp clangd/CodeComplete.h clangd/index/FileIndex.cpp clangd/index/Fil

[PATCH] D41281: [clangd] Index-based code completion.

2017-12-19 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 127536. ioeric marked an inline comment as done. ioeric added a comment. - Move implementations around to make code easier to read. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D41281 Files: clangd/CodeComplete.cpp clangd/CodeComplete.h

[PATCH] D41281: [clangd] Index-based code completion.

2017-12-19 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov accepted this revision. ilya-biryukov added a comment. LGTM. I still think that we should move the `SymbolIndex` out of the struct, but don't want to block this patch. Comment at: clangd/CodeComplete.h:64 + + // Populated internally by clangd, do not set. + ///

[PATCH] D41281: [clangd] Index-based code completion.

2017-12-19 Thread Sam McCall via Phabricator via cfe-commits
sammccall accepted this revision. sammccall added inline comments. This revision is now accepted and ready to land. Comment at: clangd/CodeComplete.cpp:111 + case SK::Using: +return CompletionItemKind::Reference; + case SK::Function: ioeric wrote: > sammcca

[PATCH] D41281: [clangd] Index-based code completion.

2017-12-19 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added inline comments. Comment at: clangd/CodeComplete.cpp:334 + Item.insertTextFormat = InsertTextFormat::PlainText; + // FIXME: sort symbols appropriately. + Item.sortText = ""; ioeric wrote: > ilya-biryukov wrote: > > NIT: FIXME(ioeric)? > > A

[PATCH] D41281: [clangd] Index-based code completion.

2017-12-19 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 127509. ioeric added a comment. - Fixed a bug when completing scope that starts with '::'. - Diff base on origin/master Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D41281 Files: clangd/CodeComplete.cpp clangd/CodeComplete.h clangd/in

[PATCH] D41281: [clangd] Index-based code completion.

2017-12-19 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 127488. ioeric added a comment. - Merged with origin/master - Merged with https://reviews.llvm.org/D41351 Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D41281 Files: clangd/CodeComplete.cpp clangd/CodeComplete.h clangd/index/FileIndex.

[PATCH] D41281: [clangd] Index-based code completion.

2017-12-18 Thread Eric Liu via Phabricator via cfe-commits
ioeric added a comment. Thanks for the review! Comment at: clangd/CodeComplete.cpp:847 + if (Opts.Index && SCInfo.SSInfo) { +// FIXME: log warning with logger if sema code completion have collected +// results. ilya-biryukov wrote: > NIT: FIXME(ioeric)

[PATCH] D41281: [clangd] Index-based code completion.

2017-12-18 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 127406. ioeric marked 21 inline comments as done. ioeric added a comment. - Address comments in CodeComplete.cpp - Split index changes into a separate patch. - Merged with patch https://reviews.llvm.org/D41351. - Remove Position.* files. Repository: rCTE Cl

[PATCH] D41281: [clangd] Index-based code completion.

2017-12-18 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added a comment. Here are a few more comments. Comment at: clangd/CodeComplete.cpp:847 + if (Opts.Index && SCInfo.SSInfo) { +// FIXME: log warning with logger if sema code completion have collected +// results. NIT: FIXME(ioeric)? Also,

[PATCH] D41281: [clangd] Index-based code completion.

2017-12-18 Thread Sam McCall via Phabricator via cfe-commits
sammccall added a comment. Hope you don't mind me piling on... let me know! Mostly readability, but i'd also like to reduce the scope w.r.t namespace completion. Comment at: clangd/CodeComplete.cpp:90 +CompletionItemKind getKindOfSymbol(index::SymbolKind Kind) { + using SK

[PATCH] D41281: [clangd] Index-based code completion.

2017-12-15 Thread Sam McCall via Phabricator via cfe-commits
sammccall added a comment. A few drive-by comments, will look deeper if I have time but don't wait for me. Comment at: clangd/Position.cpp:34 + int Lines = JustBefore.count('\n'); + int Cols = JustBefore.size() - JustBefore.rfind('\n') - 1; + return {Lines, Cols}; --

[PATCH] D41281: [clangd] Index-based code completion.

2017-12-15 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 127118. ioeric added a comment. - Merge remote-tracking branch 'origin/master' into index-completion - Fix merge with origin/master. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D41281 Files: clangd/CMakeLists.txt clangd/ClangdLSPServer

[PATCH] D41281: [clangd] Index-based code completion.

2017-12-15 Thread Eric Liu via Phabricator via cfe-commits
ioeric created this revision. ioeric added a reviewer: ilya-biryukov. Herald added subscribers: cfe-commits, mgorny, klimek. Use symbol index to populate completion results for qualfified IDs e.g. "nx::A^". Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D41281 Files: clangd/C