[PATCH] D53032: [clangd] Minimal implementation of automatic static index, behind a flag.

2018-10-15 Thread Sam McCall via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rCTE344513: [clangd] Minimal implementation of automatic static index (not enabled). (authored by sammccall, committed by ). Changed prior to commit: https://reviews.llvm.org/D53032?vs=169694=169695#toc

[PATCH] D53032: [clangd] Minimal implementation of automatic static index, behind a flag.

2018-10-15 Thread Eric Liu via Phabricator via cfe-commits
ioeric accepted this revision. ioeric added a comment. still lgtm Comment at: clangd/Compiler.cpp:83 +std::string getStandardResourceDir() { + static int Dummy; // Just an address in this process. Maybe also revert this change? Repository: rCTE Clang

[PATCH] D53032: [clangd] Minimal implementation of automatic static index, behind a flag.

2018-10-15 Thread Sam McCall via Phabricator via cfe-commits
sammccall added inline comments. Comment at: unittests/clangd/BackgroundIndexTests.cpp:14 + +TEST(BackgroundIndexTest, IndexesOneFile) { + MockFSProvider FS; sammccall wrote: > ioeric wrote: > > sammccall wrote: > > > ioeric wrote: > > > > sammccall wrote: > >

[PATCH] D53032: [clangd] Minimal implementation of automatic static index, behind a flag.

2018-10-15 Thread Sam McCall via Phabricator via cfe-commits
sammccall updated this revision to Diff 169694. sammccall marked an inline comment as done. sammccall added a comment. Address comments, strip out of clangdlspserver for now. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53032 Files: clangd/CMakeLists.txt

[PATCH] D53032: [clangd] Minimal implementation of automatic static index, behind a flag.

2018-10-12 Thread Sam McCall via Phabricator via cfe-commits
sammccall added inline comments. Comment at: unittests/clangd/BackgroundIndexTests.cpp:14 + +TEST(BackgroundIndexTest, IndexesOneFile) { + MockFSProvider FS; ioeric wrote: > sammccall wrote: > > ioeric wrote: > > > sammccall wrote: > > > > ioeric wrote: > > > >

[PATCH] D53032: [clangd] Minimal implementation of automatic static index, behind a flag.

2018-10-12 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: unittests/clangd/BackgroundIndexTests.cpp:14 + +TEST(BackgroundIndexTest, IndexesOneFile) { + MockFSProvider FS; sammccall wrote: > ioeric wrote: > > sammccall wrote: > > > ioeric wrote: > > > > Also add a test for

[PATCH] D53032: [clangd] Minimal implementation of automatic static index, behind a flag.

2018-10-12 Thread Sam McCall via Phabricator via cfe-commits
sammccall added inline comments. Comment at: unittests/clangd/BackgroundIndexTests.cpp:14 + +TEST(BackgroundIndexTest, IndexesOneFile) { + MockFSProvider FS; ioeric wrote: > sammccall wrote: > > ioeric wrote: > > > Also add a test for `enqueueAll` with multiple

[PATCH] D53032: [clangd] Minimal implementation of automatic static index, behind a flag.

2018-10-12 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: unittests/clangd/BackgroundIndexTests.cpp:14 + +TEST(BackgroundIndexTest, IndexesOneFile) { + MockFSProvider FS; sammccall wrote: > ioeric wrote: > > Also add a test for `enqueueAll` with multiple TUs ? > Is it

[PATCH] D53032: [clangd] Minimal implementation of automatic static index, behind a flag.

2018-10-12 Thread Sam McCall via Phabricator via cfe-commits
sammccall added inline comments. Comment at: unittests/clangd/BackgroundIndexTests.cpp:14 + +TEST(BackgroundIndexTest, IndexesOneFile) { + MockFSProvider FS; ioeric wrote: > Also add a test for `enqueueAll` with multiple TUs ? Is it important to call

[PATCH] D53032: [clangd] Minimal implementation of automatic static index, behind a flag.

2018-10-12 Thread Eric Liu via Phabricator via cfe-commits
ioeric accepted this revision. ioeric added inline comments. This revision is now accepted and ready to land. Comment at: clangd/index/Background.cpp:51 + std::unique_lock Lock(QueueMu); + assert(!HasActiveTask); + QueueCV.wait(Lock, [&] { return ShouldStop ||

[PATCH] D53032: [clangd] Minimal implementation of automatic static index, behind a flag.

2018-10-12 Thread Sam McCall via Phabricator via cfe-commits
sammccall added inline comments. Comment at: clangd/ClangdLSPServer.h:117 +llvm::Optional CompileCommandsDir, +std::function); ioeric wrote: > please document what the callback is for and how often it's called. Documented at the callsite and in

[PATCH] D53032: [clangd] Minimal implementation of automatic static index, behind a flag.

2018-10-12 Thread Sam McCall via Phabricator via cfe-commits
sammccall updated this revision to Diff 169400. sammccall added a comment. Oops, forgot one comment. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53032 Files: clangd/CMakeLists.txt clangd/ClangdLSPServer.cpp clangd/ClangdLSPServer.h clangd/ClangdServer.cpp

[PATCH] D53032: [clangd] Minimal implementation of automatic static index, behind a flag.

2018-10-12 Thread Sam McCall via Phabricator via cfe-commits
sammccall updated this revision to Diff 169399. sammccall marked 4 inline comments as done. sammccall added a comment. Address comments, add tests. Some changes (enqueue(), blockUntilIdleForTest()) to support testing. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53032 Files:

[PATCH] D53032: [clangd] Minimal implementation of automatic static index, behind a flag.

2018-10-12 Thread Sam McCall via Phabricator via cfe-commits
sammccall marked 6 inline comments as done. sammccall added inline comments. Comment at: clangd/index/Background.cpp:98 + } + llvm::sys::path::native(AbsolutePath); + ioeric wrote: > Why is this needed? Removed. I copied it from the related code in

[PATCH] D53032: [clangd] Minimal implementation of automatic static index, behind a flag.

2018-10-12 Thread Eric Liu via Phabricator via cfe-commits
ioeric added a comment. Looks good in general. Comment at: clangd/ClangdLSPServer.h:117 +llvm::Optional CompileCommandsDir, +std::function); please document what the callback is for and how often it's called. Comment at:

[PATCH] D53032: [clangd] Minimal implementation of automatic static index, behind a flag.

2018-10-09 Thread Sam McCall via Phabricator via cfe-commits
sammccall created this revision. sammccall added a reviewer: ioeric. Herald added subscribers: cfe-commits, jfb, kadircet, arphaman, jkorous, MaskRay, ilya-biryukov, mgorny. See tinyurl.com/clangd-automatic-index for design and goals. Lots of limitations to keep this patch smallish, TODOs