[PATCH] D50962: [clangd] Speculative code completion index request before Sema is run.

2018-08-24 Thread Eric Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rCTE340604: [clangd] Speculative code completion index request before Sema is run. (authored by ioeric, committed by ). Changed prior to commit: https://reviews.llvm.org/D50962?vs=162356&id=162358#toc Re

[PATCH] D50962: [clangd] Speculative code completion index request before Sema is run.

2018-08-24 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 162356. ioeric added a comment. - add doc Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D50962 Files: clangd/ClangdServer.cpp clangd/ClangdServer.h clangd/CodeComplete.cpp clangd/CodeComplete.h clangd/TUScheduler.h clangd/index/I

[PATCH] D50962: [clangd] Speculative code completion index request before Sema is run.

2018-08-24 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov accepted this revision. ilya-biryukov added a comment. This revision is now accepted and ready to land. LG, thanks. And two small NITs. Comment at: clangd/CodeComplete.h:184 +llvm::Expected +speculateCompletionFilter(llvm::StringRef Content, Position Pos); + -

[PATCH] D50962: [clangd] Speculative code completion index request before Sema is run.

2018-08-24 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 162355. ioeric added a comment. - moved SpecReq into CodeComplete.cpp Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D50962 Files: clangd/ClangdServer.cpp clangd/ClangdServer.h clangd/CodeComplete.cpp clangd/CodeComplete.h clangd/TU

[PATCH] D50962: [clangd] Speculative code completion index request before Sema is run.

2018-08-24 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 162351. ioeric added a comment. - fix doc Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D50962 Files: clangd/ClangdServer.cpp clangd/ClangdServer.h clangd/CodeComplete.cpp clangd/CodeComplete.h clangd/TUScheduler.h clangd/index/I

[PATCH] D50962: [clangd] Speculative code completion index request before Sema is run.

2018-08-24 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added inline comments. Comment at: clangd/CodeComplete.h:187 +/// A speculative and asynchronous fuzzy find index request (based on cached +/// request) that can be before parsing sema. This would reduce completion +/// latency if the speculation succeeds. -

[PATCH] D50962: [clangd] Speculative code completion index request before Sema is run.

2018-08-24 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added inline comments. Comment at: clangd/CodeComplete.h:187 +/// A speculative and asynchronous fuzzy find index request (based on cached +/// request) that can be before parsing sema. This would reduce completion +/// latency if the speculation succeeds. -

[PATCH] D50962: [clangd] Speculative code completion index request before Sema is run.

2018-08-24 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 162348. ioeric marked 5 inline comments as done. ioeric added a comment. - Merge remote-tracking branch 'origin/master' into speculate-index - address comments. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D50962 Files: clangd/ClangdServe

[PATCH] D50962: [clangd] Speculative code completion index request before Sema is run.

2018-08-24 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added inline comments. Comment at: clangd/ClangdServer.cpp:159 + } + if (SpecFuzzyReq) { +if (auto Filter = speculateCompletionFilter(Content, Pos)) { ioeric wrote: > ilya-biryukov wrote: > > NIT: maybe invert condition to reduce nesting? > It

[PATCH] D50962: [clangd] Speculative code completion index request before Sema is run.

2018-08-24 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 162335. ioeric added a comment. - fix typos.. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D50962 Files: clangd/ClangdServer.cpp clangd/ClangdServer.h clangd/CodeComplete.cpp clangd/CodeComplete.h clangd/TUScheduler.h clangd/ind

[PATCH] D50962: [clangd] Speculative code completion index request before Sema is run.

2018-08-23 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 162224. ioeric added a comment. - another minior cleanup Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D50962 Files: clangd/ClangdServer.cpp clangd/ClangdServer.h clangd/CodeComplete.cpp clangd/CodeComplete.h clangd/TUScheduler.h

[PATCH] D50962: [clangd] Speculative code completion index request before Sema is run.

2018-08-23 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: clangd/ClangdServer.cpp:159 + } + if (SpecFuzzyReq) { +if (auto Filter = speculateCompletionFilter(Content, Pos)) { ilya-biryukov wrote: > NIT: maybe invert condition to reduce nesting? It would become something lik

[PATCH] D50962: [clangd] Speculative code completion index request before Sema is run.

2018-08-23 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 16. ioeric added a comment. - minor cleanup Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D50962 Files: clangd/ClangdServer.cpp clangd/ClangdServer.h clangd/CodeComplete.cpp clangd/CodeComplete.h clangd/TUScheduler.h clangd/i

[PATCH] D50962: [clangd] Speculative code completion index request before Sema is run.

2018-08-23 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 162221. ioeric marked 5 inline comments as done. ioeric added a comment. Herald added subscribers: jfb, javed.absar. - Moved most logic into CodeComplete.cc Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D50962 Files: clangd/ClangdServer.cp

[PATCH] D50962: [clangd] Speculative code completion index request before Sema is run.

2018-08-23 Thread Ilya Biryukov via Phabricator via cfe-commits
ilya-biryukov added a comment. Really excited about this one, this should give us decent latency improvements when using the static index. My main suggestion would be to put almost all of the speculating code into `CodeComplete.cpp`. We could merely return the request that should be used for sp

[PATCH] D50962: [clangd] Speculative code completion index request before Sema is run.

2018-08-22 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 161937. ioeric added a comment. - minor cleanup. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D50962 Files: clangd/ClangdServer.cpp clangd/ClangdServer.h clangd/CodeComplete.cpp clangd/CodeComplete.h clangd/index/Index.cpp clang

[PATCH] D50962: [clangd] Speculative code completion index request before Sema is run.

2018-08-21 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: unittests/clangd/CodeCompleteTests.cpp:1710 + $bol^ + ab$ab^ + x.ab$dot^ kadircet wrote: > Maybe an EXPECT for this one as well? Nice catch! Repository: rCTE Clang Tools Extra https://reviews.llvm.org/

[PATCH] D50962: [clangd] Speculative code completion index request before Sema is run.

2018-08-21 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 161651. ioeric marked an inline comment as done. ioeric added a comment. - Improve tests. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D50962 Files: clangd/ClangdServer.cpp clangd/ClangdServer.h clangd/CodeComplete.cpp clangd/CodeCo

[PATCH] D50962: [clangd] Speculative code completion index request before Sema is run.

2018-08-20 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet added inline comments. Comment at: unittests/clangd/CodeCompleteTests.cpp:1710 + $bol^ + ab$ab^ + x.ab$dot^ Maybe an EXPECT for this one as well? Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D50962 __

[PATCH] D50962: [clangd] Speculative code completion index request before Sema is run.

2018-08-20 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 161537. ioeric added a comment. - Make sure completion result callback can be called even if the unused speculative request has not finished. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D50962 Files: clangd/ClangdServer.cpp clangd/Cla

[PATCH] D50962: [clangd] Speculative code completion index request before Sema is run.

2018-08-20 Thread Eric Liu via Phabricator via cfe-commits
ioeric planned changes to this revision. ioeric added a comment. I just realized that `CodeCompleteFlow` would be blocked by the speculative index request even when index request is not needed (e.g. member access), because it owns the future object. This can make some completion requests slower

[PATCH] D50962: [clangd] Speculative code completion index request before Sema is run.

2018-08-20 Thread Eric Liu via Phabricator via cfe-commits
ioeric created this revision. ioeric added reviewers: hokein, ilya-biryukov. Herald added subscribers: cfe-commits, kadircet, arphaman, jkorous, MaskRay. For index-based code completion, send an asynchronous speculative index request, based on the index request for the last code completion on the