[PATCH] D41232: [clangd] Add a FileSymbols container that manages symbols from multiple files.

2017-12-14 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 126944. ioeric added a comment. - fix HEADER_GUARD Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D41232 Files: clangd/CMakeLists.txt clangd/index/FileSymbols.cpp clangd/index/FileSymbols.h unittests/clangd/CMakeLists.txt unittests/

[PATCH] D41232: [clangd] Add a FileSymbols container that manages symbols from multiple files.

2017-12-14 Thread Eric Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL320701: [clangd] Add a FileSymbols container that manages symbols from multiple files. (authored by ioeric, committed by ). Repository: rL LLVM https://reviews.llvm.org/D41232 Files: clang-tools-ext

[PATCH] D40548: [clangd] Symbol index interfaces and an in-memory index implementation.

2017-12-14 Thread Eric Liu via Phabricator via cfe-commits
ioeric added a comment. In https://reviews.llvm.org/D40548#955289, @malaperle wrote: > In https://reviews.llvm.org/D40548#947081, @ioeric wrote: > > > Hi Marc, the patch is not ready for review yet. I am still cleaning up the > > prototype and will let you know when it's ready for review. > > >

[PATCH] D41276: [clangd] Build in-memory index on symbols in files.

2017-12-15 Thread Eric Liu via Phabricator via cfe-commits
ioeric created this revision. ioeric added a reviewer: sammccall. Herald added subscribers: cfe-commits, ilya-biryukov, mgorny, klimek. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D41276 Files: clangd/CMakeLists.txt clangd/index/FileMemIndexManager.cpp clangd/index/FileMe

[PATCH] D40548: [clangd] Symbol index interfaces and an in-memory index implementation.

2017-12-15 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: clangd/index/Index.h:134 + virtual bool + fuzzyFind(Context &Ctx, const FuzzyFindRequest &Req, +std::function Callback) const = 0; malaperle wrote: > ioeric wrote: > > malaperle wrote: > > > I think a more g

[PATCH] D41276: [clangd] Build in-memory index on symbols in files.

2017-12-15 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 127086. ioeric added a comment. - Address review comments. Merge FileSymbols and tests into FileIndex. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D41276 Files: clangd/CMakeLists.txt clangd/index/FileIndex.cpp clangd/index/FileIndex.

[PATCH] D41276: [clangd] Build in-memory index on symbols in files.

2017-12-15 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 127087. ioeric added a comment. - Minor cleanup Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D41276 Files: clangd/CMakeLists.txt clangd/index/FileIndex.cpp clangd/index/FileIndex.h unittests/clangd/CMakeLists.txt unittests/clangd/

[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

[PATCH] D41276: [clangd] Build in-memory index on symbols in files.

2017-12-15 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 127098. ioeric marked 2 inline comments as done. ioeric added a comment. - Removed unused files and addressed comments. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D41276 Files: clangd/CMakeLists.txt clangd/index/FileIndex.cpp clangd

[PATCH] D41276: [clangd] Build in-memory index on symbols in files.

2017-12-15 Thread Eric Liu via Phabricator via cfe-commits
ioeric added a comment. In https://reviews.llvm.org/D41276#956513, @sammccall wrote: > I don't see `FileSymbols.{h,cpp}` being deleted, but maybe I'm bad at reading > diffs. No, I'm bad at creating diffs... Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D41276

[PATCH] D41276: [clangd] Build in-memory index on symbols in files.

2017-12-15 Thread Eric Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL320807: [clangd] Build in-memory index on symbols in files. (authored by ioeric, committed by ). Changed prior to commit: https://reviews.llvm.org/D41276?vs=127098&id=127099#toc Repository: rL LLVM

[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] D41289: [clangd] Build dynamic index and use it for code completion.

2017-12-15 Thread Eric Liu via Phabricator via cfe-commits
ioeric created this revision. ioeric added a reviewer: sammccall. Herald added subscribers: cfe-commits, ilya-biryukov, klimek. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D41289 Files: clangd/ClangdLSPServer.cpp clangd/ClangdLSPServer.h clangd/ClangdServer.cpp clangd/C

[PATCH] D41345: [clangd] Add more symbol information for code completion.

2017-12-18 Thread Eric Liu via Phabricator via cfe-commits
ioeric created this revision. ioeric added reviewers: hokein, sammccall. Herald added subscribers: cfe-commits, ilya-biryukov, klimek. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D41345 Files: clangd/ClangdUnit.cpp clangd/ClangdUnit.h clangd/index/FileIndex.cpp clangd/i

[PATCH] D41367: [clangd] Support filtering by fixing scopes in fuzzyFind.

2017-12-18 Thread Eric Liu via Phabricator via cfe-commits
ioeric created this revision. ioeric added a reviewer: sammccall. Herald added subscribers: cfe-commits, ilya-biryukov, klimek. When scopes are specified, only match symbols from scopes. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D41367 Files: clangd/index/Index.h clangd

[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 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] D41367: [clangd] Support filtering by fixing scopes in fuzzyFind.

2017-12-18 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 127409. ioeric added a comment. - minor cleanup. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D41367 Files: clangd/index/Index.h clangd/index/MemIndex.cpp unittests/clangd/IndexTests.cpp Index: unittests/clangd/IndexTests.cpp ===

[PATCH] D41367: [clangd] Support filtering by fixing scopes in fuzzyFind.

2017-12-19 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 127478. ioeric marked 3 inline comments as done. ioeric added a comment. - Address review comments. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D41367 Files: clangd/index/Index.h clangd/index/MemIndex.cpp clangd/index/SymbolCollector

[PATCH] D41367: [clangd] Support filtering by fixing scopes in fuzzyFind.

2017-12-19 Thread Eric Liu via Phabricator via cfe-commits
ioeric added a comment. Thanks for the review! Comment at: clangd/index/Index.h:127 /// \brief A query string for the fuzzy find. This is matched against symbols' - /// qualfified names. + /// qualified names. If any scope below is provided, \p Query is only matched + //

[PATCH] D41351: [clangd] Expose offset <-> LSP position functions, and fix bugs

2017-12-19 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/D41351 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.l

[PATCH] D41367: [clangd] Support filtering by fixing scopes in fuzzyFind.

2017-12-19 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 127484. ioeric marked 3 inline comments as done. ioeric added a comment. - Address a few more comments. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D41367 Files: clangd/index/Index.h clangd/index/MemIndex.cpp clangd/index/SymbolColle

[PATCH] D41367: [clangd] Support filtering by fixing scopes in fuzzyFind.

2017-12-19 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 127486. ioeric added a comment. - Minor cleanup Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D41367 Files: clangd/index/Index.h clangd/index/MemIndex.cpp clangd/index/SymbolCollector.cpp clangd/index/SymbolYAML.cpp unittests/clang

[PATCH] D41367: [clangd] Support filtering by fixing scopes in fuzzyFind.

2017-12-19 Thread Eric Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rCTE321067: [clangd] Support filtering by fixing scopes in fuzzyFind. (authored by ioeric, committed by ). Changed prior to commit: https://reviews.llvm.org/D41367?vs=127486&id=127487#toc Repository: r

[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] D41289: [clangd] Build dynamic index and use it for code completion.

2017-12-19 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 127493. ioeric added a comment. - Merge with updated https://reviews.llvm.org/D41281 - Fix broken merge Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D41289 Files: clangd/ClangdLSPServer.cpp clangd/ClangdLSPServer.h clangd/ClangdServer

[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 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 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 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
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] D41289: [clangd] Build dynamic index and use it for code completion.

2017-12-19 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 127544. ioeric added a comment. - Merge with https://reviews.llvm.org/D41289. - Merge with origin/master Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D41289 Files: clangd/ClangdLSPServer.cpp clangd/ClangdLSPServer.h clangd/ClangdServe

[PATCH] D41289: [clangd] Build dynamic index and use it for code completion.

2017-12-19 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 127554. ioeric marked 4 inline comments as done. ioeric added a comment. - Address review comments. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D41289 Files: clangd/ClangdLSPServer.cpp clangd/ClangdLSPServer.h clangd/ClangdServer.cpp

[PATCH] D41289: [clangd] Build dynamic index and use it for code completion.

2017-12-19 Thread Eric Liu via Phabricator via cfe-commits
ioeric added a comment. Thanks for the quick review! Comment at: clangd/ClangdUnit.cpp:617 + new CppFile(FileName, std::move(Command), StorePreamblesInMemory, + std::move(PCHs), std::move(ASTCallback))); } sammccall wrote: > CppFile doesn

[PATCH] D41289: [clangd] Build dynamic index and use it for 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 rCTE321092: [clangd] Build dynamic index and use it for code completion. (authored by ioeric, committed by ). Changed prior to commit: https://reviews.llvm.org/D41289?vs=127554&id=127555#toc Repository:

[PATCH] D39050: Add index-while-building support to Clang

2017-12-19 Thread Eric Liu via Phabricator via cfe-commits
ioeric added a comment. Thanks a lot for further cleaning up the patch! It is now much easier to review. I really appreciate it! Some more comments on the public APIs and the layering of classes. There are a lot of helper classes in the implementation, so I think it's important to get a clear

[PATCH] D39050: Add index-while-building support to Clang

2017-12-19 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: include/clang/Index/IndexUnitDataConsumer.h:1 +//===--- IndexUnitDataConsumer.h - Abstract index unit data consumer ---===// +// ioeric wrote: > IIUC, this is the index data for a translation unit, as opposed

[PATCH] D41432: [clangd] Switch xrefs and documenthighlight to annotated-code unit tests. NFC

2017-12-20 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! This is amazing! Comment at: unittests/clangd/Annotations.h:12 +// +//Annotations Example(R"cpp( +// int complete() { x.pri^ } // ^ indicates a point

[PATCH] D41450: [clangd] Pull CodeCompletionString handling logic into its own file and add unit test.

2017-12-20 Thread Eric Liu via Phabricator via cfe-commits
ioeric created this revision. ioeric added a reviewer: sammccall. Herald added subscribers: cfe-commits, ilya-biryukov, mgorny, klimek. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D41450 Files: clangd/CMakeLists.txt clangd/CodeComplete.cpp clangd/CompletionString.cpp cl

[PATCH] D41345: [clangd] Add more symbol information for code completion.

2017-12-20 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 127730. ioeric marked 4 inline comments as done. ioeric added a comment. - Merge with origin/master - Fixed an error in merge - Make documentation etc optional in symbols - Merge remote-tracking branch 'origin/master' into symbol - Merge branch 'index-completio

[PATCH] D41345: [clangd] Add more symbol information for code completion.

2017-12-20 Thread Eric Liu via Phabricator via cfe-commits
ioeric added a comment. Thanks for the review! Logic around CodeCompletionString is pulled into a separate file in https://reviews.llvm.org/D41450. I also propagate the new completion info to completion code. I am happy to split it out if it adds too much noise for the review. =

[PATCH] D41450: [clangd] Pull CodeCompletionString handling logic into its own file and add unit test.

2017-12-20 Thread Eric Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. ioeric marked 7 inline comments as done. Closed by commit rCTE321193: [clangd] Pull CodeCompletionString handling logic into its own file and add… (authored by ioeric, committed by ). Changed prior to commit: https://revi

[PATCH] D41345: [clangd] Add more symbol information for code completion.

2017-12-20 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 127781. ioeric marked an inline comment as done. ioeric added a comment. - Merged with origin/master - Addressed some more comments. - Add new fields to YAML. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D41345 Files: clangd/ClangdUnit.cp

[PATCH] D41345: [clangd] Add more symbol information for code completion.

2017-12-20 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: clangd/index/Index.h:105 + /// What to insert when completing this symbol (plain text version). + std::string CompletionPlainInsertText; + /// What to insert when completing this symbol (snippet version). sammccall wro

[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-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] D41345: [clangd] Add more symbol information for code completion.

2018-01-03 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 128505. ioeric added a comment. - Merge with origin/master. Use Arena for symbol details. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D41345 Files: clangd/ClangdUnit.cpp clangd/ClangdUnit.h clangd/CodeComplete.cpp clangd/index/File

[PATCH] D41345: [clangd] Add more symbol information for code completion.

2018-01-03 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: clangd/index/Index.h:122 + + llvm::Optional Detail; + sammccall wrote: > ioeric wrote: > > sammccall wrote: > > > I think you probably want a raw pointer rather than optional: > > > - reduce the size of the struct when

[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] D39050: Add index-while-building support to Clang

2018-01-03 Thread Eric Liu via Phabricator via cfe-commits
ioeric requested changes to this revision. ioeric added a comment. This revision now requires changes to proceed. (I think I forgot to update the patch status :) https://reviews.llvm.org/D39050 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D41729: Add a tool executor that runs actions on all TUs in the compilation database.

2018-01-04 Thread Eric Liu via Phabricator via cfe-commits
ioeric created this revision. ioeric added a reviewer: hokein. Herald added subscribers: cfe-commits, mgorny, klimek. Tool results are deduplicated by the result key. Repository: rC Clang https://reviews.llvm.org/D41729 Files: include/clang/Tooling/AllTUsExecution.h lib/Tooling/AllTUsExe

[PATCH] D41730: [clangd] Use ToolExecutor to write the global-symbol-builder tool.

2018-01-04 Thread Eric Liu via Phabricator via cfe-commits
ioeric created this revision. ioeric added reviewers: hokein, sammccall. Herald added subscribers: cfe-commits, ilya-biryukov, klimek. This enables more execution modes like standalone and Mapreduce-style execution. See also https://reviews.llvm.org/D41729 Repository: rCTE Clang Tools Extra

[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] D41729: Add a tool executor that runs actions on all TUs in the compilation database.

2018-01-05 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 128719. ioeric marked 2 inline comments as done. ioeric added a comment. Address review comments. Repository: rC Clang https://reviews.llvm.org/D41729 Files: include/clang/Tooling/AllTUsExecution.h lib/Tooling/AllTUsExecution.cpp lib/Tooling/CMakeLi

[PATCH] D41729: Add a tool executor that runs actions on all TUs in the compilation database.

2018-01-05 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: include/clang/Tooling/AllTUsExecution.h:34 + AllTUsToolExecutor(const CompilationDatabase &Compilations, + unsigned ThreadCount, + std::shared_ptr PCHContainerOps = hokein wrote: >

[PATCH] D41729: Add a tool executor that runs actions on all TUs in the compilation database.

2018-01-05 Thread Eric Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC321864: Add a tool executor that runs actions on all TUs in the compilation database. (authored by ioeric, committed by ). Changed prior to commit: https://reviews.llvm.org/D41729?vs=128719&id=128720#to

[PATCH] D41730: [clangd] Use ToolExecutor to write the global-symbol-builder tool.

2018-01-05 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: clangd/index/SymbolYAML.cpp:140 llvm::yaml::Output Yout(OS); for (Symbol S : Symbols) // copy: Yout<< requires mutability. Yout<< S; hokein wrote: > The function could be simplified by using the SymbolToYAML be

[PATCH] D41730: [clangd] Use ToolExecutor to write the global-symbol-builder tool.

2018-01-05 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 128723. ioeric marked 2 inline comments as done. ioeric added a comment. Address review comments. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D41730 Files: clangd/global-symbol-builder/GlobalSymbolBuilderMain.cpp clangd/index/SymbolCol

[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] D41823: [clangd] Add more filters for collected symbols.

2018-01-08 Thread Eric Liu via Phabricator via cfe-commits
ioeric created this revision. ioeric added reviewers: hokein, ilya-biryukov. Herald added subscribers: cfe-commits, klimek. o We only collect symbols in namespace or translation unit scopes. o Add an option to only collect symbols in included headers. Repository: rCTE Clang Tools Extra https:

[PATCH] D41345: [clangd] Add more symbol information for code completion.

2018-01-09 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 129058. ioeric marked 2 inline comments as done. ioeric added a comment. - [clangd] Address review comments; made Detail a pointer. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D41345 Files: clangd/ClangdUnit.cpp clangd/ClangdUnit.h c

[PATCH] D41345: [clangd] Add more symbol information for code completion.

2018-01-09 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 129059. ioeric marked an inline comment as done. ioeric added a comment. - Minor cleanup. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D41345 Files: clangd/ClangdUnit.cpp clangd/ClangdUnit.h clangd/CodeComplete.cpp clangd/index/File

[PATCH] D41730: [clangd] Use ToolExecutor to write the global-symbol-builder tool.

2018-01-09 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 129063. ioeric added a comment. Address review comment: move all ToolExecutor and YAML-specific logics out of SymbolCollector. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D41730 Files: clangd/global-symbol-builder/GlobalSymbolBuilderMai

[PATCH] D41730: [clangd] Use ToolExecutor to write the global-symbol-builder tool.

2018-01-09 Thread Eric Liu via Phabricator via cfe-commits
ioeric added a comment. In https://reviews.llvm.org/D41730#970704, @sammccall wrote: > This makes `SymbolCollector` (production code) depend on YAML (explicitly > experimental), as well as on Tooling interfaces. > At least we should invert this by making the thing passed to SymbolCollector > a

[PATCH] D41345: [clangd] Add more symbol information for code completion.

2018-01-09 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 129075. ioeric added a comment. - Merge branch 'master' of http://llvm.org/git/clang-tools-extra into symbol Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D41345 Files: clangd/ClangdUnit.cpp clangd/ClangdUnit.h clangd/CodeComplete.cpp

[PATCH] D41345: [clangd] Add more symbol information for code completion.

2018-01-09 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: clangd/index/Index.h:122 + + llvm::Optional Detail; + sammccall wrote: > ioeric wrote: > > sammccall wrote: > > > ioeric wrote: > > > > sammccall wrote: > > > > > I think you probably want a raw pointer rather than optio

[PATCH] D41823: [clangd] Add more filters for collected symbols.

2018-01-09 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 129078. ioeric marked 4 inline comments as done. ioeric added a comment. - Addressed comments. - Merged with origin/master - Merge with diff base. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D41823 Files: clangd/global-symbol-builder/Glo

[PATCH] D41823: [clangd] Add more filters for collected symbols.

2018-01-09 Thread Eric Liu via Phabricator via cfe-commits
ioeric added a comment. Thanks for the reviews! Comment at: clangd/index/FileIndex.cpp:22 llvm::ArrayRef Decls) { - auto Collector = std::make_shared(); + auto CollectorOpts = SymbolCollector::Options(); + CollectorOpts.IndexMainFiles =

[PATCH] D41730: [clangd] Use ToolExecutor to write the global-symbol-builder tool.

2018-01-09 Thread Eric Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL322084: [clangd] Use ToolExecutor to write the global-symbol-builder tool. (authored by ioeric, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews.llvm.org/D41

[PATCH] D41345: [clangd] Add more symbol information for code completion.

2018-01-09 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 129106. ioeric marked an inline comment as done. ioeric added a comment. - Addrress review comment. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D41345 Files: clangd/ClangdUnit.cpp clangd/ClangdUnit.h clangd/CodeComplete.cpp clangd/

[PATCH] D41345: [clangd] Add more symbol information for code completion.

2018-01-09 Thread Eric Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rCTE322097: [clangd] Add more symbol information for code completion. (authored by ioeric, committed by ). Changed prior to commit: https://reviews.llvm.org/D41345?vs=129106&id=129110#toc Repository: r

[PATCH] D41823: [clangd] Add more filters for collected symbols.

2018-01-09 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 129112. ioeric added a comment. - Rebase on origin/master Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D41823 Files: clangd/global-symbol-builder/GlobalSymbolBuilderMain.cpp clangd/index/FileIndex.cpp clangd/index/SymbolCollector.cpp

[PATCH] D41823: [clangd] Add more filters for collected symbols.

2018-01-10 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 129275. ioeric marked 2 inline comments as done. ioeric added a comment. - Merge branch 'master' of http://llvm.org/git/clang-tools-extra into collector - Address review comments. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D41823 Files:

[PATCH] D41823: [clangd] Add more filters for collected symbols.

2018-01-10 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: clangd/index/SymbolCollector.cpp:80 +: decl(unless(isExpansionInMainFile())), +hasDeclContext(anyOf(namespaceDecl(), translationUnitDecl(), +*D, *ASTCtx) ---

[PATCH] D41823: [clangd] Add more filters for collected symbols.

2018-01-10 Thread Eric Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL322193: [clangd] Add more filters for collected symbols. (authored by ioeric, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews.llvm.org/D41823 Files: cla

[PATCH] D41946: [clangd] Add support for different file URI schemas.

2018-01-11 Thread Eric Liu via Phabricator via cfe-commits
ioeric created this revision. ioeric added a reviewer: sammccall. Herald added subscribers: cfe-commits, ilya-biryukov, mgorny, klimek. DO NOT SUBMIT: We should replace the existing URI struct in Protocol.h with the new URI and rename FileURI to URI. But before doing that, I'd like to early feedba

[PATCH] D43764: [clang-apply-replacements] Convert tooling::Replacements to tooling::AtomicChange for conflict resolving of changes, code cleanup, and code formatting.

2018-02-27 Thread Eric Liu via Phabricator via cfe-commits
ioeric added a comment. Thanks for the cleanup! This looks really nice! Comment at: clang-apply-replacements/include/clang-apply-replacements/Tooling/ApplyReplacements.h:45 +/// \brief Map mapping file name to AtomicChange targeting that file. +typedef llvm::DenseMap +File

[PATCH] D43823: [clangd] Prefer the definition of a TagDecl (e.g. class) as CanonicalDeclaration.

2018-02-27 Thread Eric Liu via Phabricator via cfe-commits
ioeric created this revision. ioeric added a reviewer: sammccall. Herald added subscribers: cfe-commits, jkorous-apple, ilya-biryukov, klimek. Currently, we pick the first declaration of a symbol in a TU, which is considered canonical in the clangIndex, as the canonical declaration in clangd. Thi

[PATCH] D43823: [clangd] Prefer the definition of a TagDecl (e.g. class) as CanonicalDeclaration.

2018-02-28 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 136247. ioeric marked 5 inline comments as done. ioeric added a comment. - Addressed review comments. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D43823 Files: clangd/index/FileIndex.cpp clangd/index/SymbolCollector.cpp clangd/index/

[PATCH] D43823: [clangd] Prefer the definition of a TagDecl (e.g. class) as CanonicalDeclaration.

2018-02-28 Thread Eric Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL326313: [clangd] Prefer the definition of a TagDecl (e.g. class) as… (authored by ioeric, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews.llvm.org/D43823 F

[PATCH] D43823: [clangd] Prefer the definition of a TagDecl (e.g. class) as CanonicalDeclaration.

2018-02-28 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: clangd/index/SymbolCollector.cpp:260 BasicSymbol = addDeclaration(*ND, std::move(ID)); +else if (isPreferredDeclaration(OriginalDecl, Roles)) + BasicSymbol = addDeclaration(OriginalDecl, std::move(ID)); sa

[PATCH] D43869: [clangd] Support include canonicalization in symbol leve.

2018-02-28 Thread Eric Liu via Phabricator via cfe-commits
ioeric created this revision. ioeric added reviewers: sammccall, hokein. Herald added subscribers: cfe-commits, jkorous-apple, ilya-biryukov, klimek. Symbols with different canonical includes might be defined in the same header (e.g. symbols defined in STL ). This patch adds support for mapping fr

[PATCH] D43823: [clangd] Prefer the definition of a TagDecl (e.g. class) as CanonicalDeclaration.

2018-02-28 Thread Eric Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rCTE326313: [clangd] Prefer the definition of a TagDecl (e.g. class) as… (authored by ioeric, committed by ). Changed prior to commit: https://reviews.llvm.org/D43823?vs=136247&id=136248#toc Repository:

[PATCH] D43869: [clangd] Support include canonicalization in symbol leve.

2018-03-01 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: clangd/index/CanonicalIncludes.cpp:83 + static const std::vector> SymbolMap = { + // Map symbols in to their preferred includes. + {"std::basic_filebuf", ""}, hokein wrote: > Looks like the list only contains

[PATCH] D43869: [clangd] Support include canonicalization in symbol leve.

2018-03-01 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 136561. ioeric marked 2 inline comments as done. ioeric added a comment. - Merge with origin/master - Address review comments. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D43869 Files: clangd/index/CanonicalIncludes.cpp clangd/index/Ca

[PATCH] D43869: [clangd] Support include canonicalization in symbol leve.

2018-03-01 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: clangd/index/CanonicalIncludes.h:54 /// a canonical header name. - llvm::StringRef mapHeader(llvm::StringRef Header) const; + /// An optional qualified symbol name can be provided to check against the + /// symbol mapping. -

[PATCH] D43869: [clangd] Support include canonicalization in symbol leve.

2018-03-01 Thread Eric Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rCTE326456: [clangd] Support include canonicalization in symbol leve. (authored by ioeric, committed by ). Changed prior to commit: https://reviews.llvm.org/D43869?vs=136561&id=136565#toc Repository: r

[PATCH] D43764: [clang-apply-replacements] Convert tooling::Replacements to tooling::AtomicChange for conflict resolving of changes, code cleanup, and code formatting.

2018-03-02 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: clang-apply-replacements/lib/Tooling/ApplyReplacements.cpp:207 + llvm::DenseMap> + GroupedReplacements; + jdemeule wrote: > ioeric wrote: > > I don't think we need to do the deduplication here anymore. AtomicChange

[PATCH] D44138: [clangd] Sort includes when formatting code or inserting new includes.

2018-03-06 Thread Eric Liu via Phabricator via cfe-commits
ioeric created this revision. ioeric added reviewers: hokein, ilya-biryukov. Herald added subscribers: cfe-commits, jkorous-apple, klimek. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D44138 Files: clangd/ClangdServer.cpp unittests/clangd/ClangdTests.cpp Index: unittests/cl

[PATCH] D44138: [clangd] Sort includes when formatting code or inserting new includes.

2018-03-06 Thread Eric Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rCTE326773: [clangd] Sort includes when formatting code or inserting new includes. (authored by ioeric, committed by ). Changed prior to commit: https://reviews.llvm.org/D44138?vs=137137&id=137142#toc Re

[PATCH] D44158: [clangd:vscode] Resolve symlinks for file paths from clangd.

2018-03-06 Thread Eric Liu via Phabricator via cfe-commits
ioeric created this revision. ioeric added a reviewer: sammccall. Herald added subscribers: cfe-commits, jkorous-apple, ilya-biryukov, klimek. For features like go-to-definition, clangd can point clients to symlink paths (e.g. in bazel execroot) which might not be desired if the symlink points to

[PATCH] D44158: [clangd:vscode] Resolve symlinks for file paths from clangd.

2018-03-08 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 137564. ioeric marked an inline comment as done. ioeric added a comment. - add context about the workaround. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D44158 Files: clangd/clients/clangd-vscode/src/extension.ts Index: clangd/clients/

[PATCH] D44158: [clangd:vscode] Resolve symlinks for file paths from clangd.

2018-03-08 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: clangd/clients/clangd-vscode/src/extension.ts:3 import * as vscodelc from 'vscode-languageclient'; +import { realpathSync } from 'fs'; sammccall wrote: > nit: the braces don't do anything here, right? I'm not sure... t

[PATCH] D44158: [clangd:vscode] Resolve symlinks for file paths from clangd.

2018-03-08 Thread Eric Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL327009: [clangd:vscode] Resolve symlinks for file paths from clangd. (authored by ioeric, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews.llvm.org/D44158 F

[PATCH] D44298: [clangd] Don't index template specializations.

2018-03-09 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: unittests/clangd/SymbolCollectorTests.cpp:200 + UnorderedElementsAreArray( + {QName("Foo"), QName("f1"), QName("f2"), QName("KInt"), QName("Tm

[PATCH] D44305: [clangd] Add an interface that finds symbol by SymbolID in SymbolIndex.

2018-03-09 Thread Eric Liu via Phabricator via cfe-commits
ioeric created this revision. ioeric added a reviewer: sammccall. Herald added subscribers: cfe-commits, jkorous-apple, ilya-biryukov, klimek. Potential use case: argument go-to-definition result with symbol information (e.g. function definition in cc file) that might not be in the AST. Reposito

[PATCH] D43764: [clang-apply-replacements] Convert tooling::Replacements to tooling::AtomicChange for conflict resolving of changes, code cleanup, and code formatting.

2018-03-09 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: clang-apply-replacements/lib/Tooling/ApplyReplacements.cpp:188 -bool mergeAndDeduplicate(const TUReplacements &TUs, - FileToReplacementsMap &GroupedReplacements, - clang::SourceManager &SM

[PATCH] D44305: [clangd] Add an interface that finds symbol by SymbolID in SymbolIndex.

2018-03-13 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 138204. ioeric marked 6 inline comments as done. ioeric added a comment. - - Addressed review comments. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D44305 Files: clangd/index/FileIndex.cpp clangd/index/FileIndex.h clangd/index/Index.

[PATCH] D44305: [clangd] Add an interface that finds symbol by SymbolID in SymbolIndex.

2018-03-13 Thread Eric Liu via Phabricator via cfe-commits
ioeric added a comment. Thanks for the review! Comment at: clangd/index/Index.h:268 + virtual bool + getSymbol(const SymbolID &ID, +llvm::function_ref Callback) const = 0; sammccall wrote: > sammccall wrote: > > sammccall wrote: > > > Can we make

[PATCH] D44305: [clangd] Add an interface that finds symbol by SymbolID in SymbolIndex.

2018-03-14 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: clangd/index/Merge.cpp:69 + else +B.insert(mergeSymbol(*Sym, S, &Scratch)); +}); sammccall wrote: > This could also just be callback(mergeSymbol(...)), if we keep track of the > IDs we've emitted. > This

<    1   2   3   4   5   6   7   8   9   10   >