[PATCH] D55770: [clangd] BackgroundIndex rebuilds symbol index periodically.

2018-12-18 Thread Eric Liu via Phabricator via cfe-commits
ioeric marked an inline comment as done. ioeric added inline comments. Comment at: clangd/index/Background.h:112 + const size_t BuildIndexPeriodMs; + std::atomic SymbolsUpdatedSinceLastIndex; + std::mutex IndexMu; kadircet wrote: > We already have a mutex and

[PATCH] D55770: [clangd] BackgroundIndex rebuilds symbol index periodically.

2018-12-18 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 178676. ioeric marked an inline comment as done. ioeric added a comment. - Add comment about double-check of ShouldStop. Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55770/new/ https://reviews.llvm.org/D55770 F

[PATCH] D55770: [clangd] BackgroundIndex rebuilds symbol index periodically.

2018-12-18 Thread Eric Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL349496: [clangd] BackgroundIndex rebuilds symbol index periodically. (authored by ioeric, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM CHANGES SINCE LAST ACTION https:

[PATCH] D45692: [clangd] Fix "fail to create file URI" warnings in FileIndexTest.

2018-04-16 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. lg Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D45692 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llv

[PATCH] D46001: [CodeComplete] Expose helpers to get RawComment of completion result.

2018-04-25 Thread Eric Liu via Phabricator via cfe-commits
ioeric added a comment. This seems to do what we want for clangd, but we should also get the code owner or someone who knows the code better to take a look. Repository: rC Clang https://reviews.llvm.org/D46001 ___ cfe-commits mailing list cfe-co

[PATCH] D46000: [AST] Added a helper to extract a user-friendly text of a comment.

2018-04-25 Thread Eric Liu via Phabricator via cfe-commits
ioeric added a comment. Overall looks good. Could you add tests for the new methods? Comment at: lib/AST/CommentLexer.cpp:294 void Lexer::lexCommentText(Token &T) { + if (ParseCommands) +lexCommentTextWithCommands(T); micro-nit: I'd probably ``` return Pa

[PATCH] D46065: [clangd] Add "str()" method to SymbolID.

2018-04-25 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 with a nit Comment at: clangd/index/Index.h:72 + // Returns a 40-bytes hex encoded string. + std::string str() const; I think Sam wants to reduce th

[PATCH] D46000: [AST] Added a helper to extract a user-friendly text of a comment.

2018-04-25 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: include/clang/AST/RawCommentList.h:118 + /// // Parts of it might be indented. + /// /* The comments styles might be mixed. */ + /// into I'm trying to understand how these cases and RawComment work. For t

[PATCH] D46000: [AST] Added a helper to extract a user-friendly text of a comment.

2018-04-26 Thread Eric Liu via Phabricator via cfe-commits
ioeric added a comment. Looks good. We still need tests though :) Comment at: lib/AST/RawCommentList.cpp:376 +SourceMgr.getSpellingColumnNumber(Tok.getLocation(), &LocInvalid); +if (LocInvalid) + TokColumn = 0; This is a bit confusing... Could

[PATCH] D46176: Pull helper class Environment from clangFormat into libToolingCore [NFC]

2018-04-27 Thread Eric Liu via Phabricator via cfe-commits
ioeric created this revision. ioeric added a reviewer: djasper. Herald added subscribers: cfe-commits, mgorny, klimek. This can be used to create a virtual environment (incl. VFS, source manager) for code snippets. The existing clang::format::Environment is implemented based on the new clang::tool

[PATCH] D46180: [clang-format] Refactor #include insertion/deletion functionality into a class.

2018-04-27 Thread Eric Liu via Phabricator via cfe-commits
ioeric created this revision. ioeric added a reviewer: ilya-biryukov. Herald added subscribers: cfe-commits, klimek. The class will be moved into libToolingCore as followup. The new behaviors in this patch: - New #include is inserted in the right position in a #include block to preserver sorted

[PATCH] D46180: [clang-format] Refactor #include insertion/deletion functionality into a class.

2018-04-27 Thread Eric Liu via Phabricator via cfe-commits
ioeric added a comment. There isn't actually as much code changed as it appears to be, but phabricator doens't understand the diff very well... `git diff` might be an easier way to review the patch. Repository: rC Clang https://reviews.llvm.org/D46180 ___

[PATCH] D46180: [clang-format] Refactor #include insertion/deletion functionality into a class.

2018-04-27 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 144319. ioeric marked 2 inline comments as done. ioeric added a comment. Addressed review comments. Repository: rC Clang https://reviews.llvm.org/D46180 Files: lib/Format/Format.cpp unittests/Format/CleanupTest.cpp Index: unittests/Format/CleanupTest

[PATCH] D46180: [clang-format] Refactor #include insertion/deletion functionality into a class.

2018-04-27 Thread Eric Liu via Phabricator via cfe-commits
ioeric marked 7 inline comments as done. ioeric added a comment. Thanks for reviewing this! In https://reviews.llvm.org/D46180#1080822, @ilya-biryukov wrote: > This change LG as an extraction of the helper functionality to be reused in > clang, clang-tidy, etc. > However, I feel there are pote

[PATCH] D46176: Pull helper class Environment from clangFormat into libToolingCore [NFC]

2018-04-30 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 144524. ioeric added a comment. - Revert last revision. Repository: rC Clang https://reviews.llvm.org/D46176 Files: include/clang/Tooling/Core/Environment.h lib/Format/Format.cpp lib/Format/SortJavaScriptImports.cpp lib/Format/TokenAnalyzer.cpp

[PATCH] D46180: [clang-format] Refactor #include insertion/deletion functionality into a class.

2018-05-02 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 144895. ioeric marked 3 inline comments as done. ioeric added a comment. - addressed more review comments. Repository: rC Clang https://reviews.llvm.org/D46180 Files: lib/Format/Format.cpp unittests/Format/CleanupTest.cpp Index: unittests/Format/Clea

[PATCH] D46180: [clang-format] Refactor #include insertion/deletion functionality into a class.

2018-05-02 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: lib/Format/Format.cpp:1691 // 0. Otherwise, returns the priority of the matching category or INT_MAX. - int getIncludePriority(StringRef IncludeName, bool CheckMainHeader) { + int getIncludePriority(StringRef IncludeName, bool CheckM

[PATCH] D46180: [clang-format] Refactor #include insertion/deletion functionality into a class.

2018-05-03 Thread Eric Liu via Phabricator via cfe-commits
ioeric added a comment. Friendly ping. Repository: rC Clang https://reviews.llvm.org/D46180 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D46180: [clang-format] Refactor #include insertion/deletion functionality into a class.

2018-05-04 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 145210. ioeric marked an inline comment as done. ioeric added a comment. - Addressed review comment. Repository: rC Clang https://reviews.llvm.org/D46180 Files: lib/Format/Format.cpp unittests/Format/CleanupTest.cpp Index: unittests/Format/CleanupTes

[PATCH] D46180: [clang-format] Refactor #include insertion/deletion functionality into a class.

2018-05-04 Thread Eric Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC331544: [clang-format] Refactor #include insertion/deletion functionality into a class. (authored by ioeric, committed by ). Changed prior to commit: https://reviews.llvm.org/D46180?vs=145210&id=145225#

[PATCH] D46176: Pull helper class Environment from clangFormat into libToolingCore [NFC]

2018-05-04 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 145318. ioeric added a comment. - Create SourceManagerForFile instead of Environment; put it in SourceManager.h which seems to be a better place. Repository: rC Clang https://reviews.llvm.org/D46176 Files: include/clang/Basic/SourceManager.h lib/Basi

[PATCH] D46176: Add SourceManagerForFile helper which sets up SourceManager and dependencies for a single file with code snippet

2018-05-04 Thread Eric Liu via Phabricator via cfe-commits
ioeric added a comment. Thanks for the comment and suggestion! I've changed this to `SourceManagerForFile` and move it to SourceManager.h, which seems to be a more natural fit. `SourceManagerForFile` sounds like a sensible name to me, but I'm guess there might be a better name... Repository:

[PATCH] D46496: [Tooling] Pull #include manipulation code from clangFormat into libToolingCore.

2018-05-05 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. Also pull #include related style out of FormatStyle as tooling::IncludeStyle. Repository: rC Clang https://reviews.llvm.org/D46496 Files: include/clang/Basic/SourceM

[PATCH] D46496: [Tooling] Pull #include manipulation code from clangFormat into libToolingCore.

2018-05-05 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 145384. ioeric added a comment. - Revert unintended change. Repository: rC Clang https://reviews.llvm.org/D46496 Files: include/clang/Format/Format.h include/clang/Tooling/Core/HeaderIncludes.h lib/Format/Format.cpp lib/Tooling/Core/CMakeLists.txt

[PATCH] D46497: [clangd] Populate #include insertions as additional edits in completion items.

2018-05-05 Thread Eric Liu via Phabricator via cfe-commits
ioeric created this revision. ioeric added a reviewer: sammccall. Herald added subscribers: cfe-commits, jkorous, MaskRay, ilya-biryukov, klimek. o Remove IncludeInsertion LSP command. o Populate include insertion edits synchromously in completion items. o Share the code completion compiler instan

[PATCH] D46176: Add SourceManagerForFile helper which sets up SourceManager and dependencies for a single file with code snippet

2018-05-05 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 145386. ioeric added a comment. - Replaced forward decl of DiagnosticsEngine with header include. Repository: rC Clang https://reviews.llvm.org/D46176 Files: include/clang/Basic/SourceManager.h lib/Basic/SourceManager.cpp lib/Format/Format.cpp lib

[PATCH] D48492: [clang-format] Add a default format style that can be used by users of `getStyle`

2018-06-25 Thread Eric Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL335492: [clang-format] Add a default format style that can be used by users of… (authored by ioeric, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews.llvm.or

[PATCH] D48441: [clangd] Incorporate transitive #includes into code complete proximity scoring.

2018-06-28 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: clangd/FileDistance.cpp:9 +//===--===// +// +// Is this intentionally reserved? Comment at: clangd/FileDistance.cpp:51 +for (Strin

[PATCH] D48724: [clangd] Log sema completion context kind and query scopes. NFC

2018-06-28 Thread Eric Liu via Phabricator via cfe-commits
ioeric created this revision. ioeric added a reviewer: sammccall. Herald added subscribers: cfe-commits, jkorous, MaskRay, ilya-biryukov. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D48724 Files: clangd/CodeComplete.cpp Index: clangd/CodeComplete.cpp ===

[PATCH] D48762: [clangd] codeComplete returns more structured completion items, LSP. NFC.

2018-06-29 Thread Eric Liu via Phabricator via cfe-commits
ioeric added a comment. Looks great! Mostly nits. Comment at: clangd/CodeComplete.cpp:259 + : ASTCtx(ASTCtx), ExtractDocumentation(Opts.IncludeComments) { +if (C.SemaResult) { + Completion.Name = llvm::StringRef(SemaCCS->getTypedText()); nit: shal

[PATCH] D48762: [clangd] codeComplete returns more structured completion items, LSP. NFC.

2018-06-29 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/D48762 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.l

[PATCH] D48441: [clangd] Incorporate transitive #includes into code complete proximity scoring.

2018-07-02 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. Again, we might still want to measure the performance impact on files with potentially large #include tree ;) Comment at: clangd/FileDistance.cpp:26 +// /bar/foo

[PATCH] D48821: [clangd] ClangdServer::codeComplete return CodeCompleteResult, not LSP struct.

2018-07-02 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/D48821 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.l

[PATCH] D47537: [clang-tools-extra] Cleanup documentation routine

2018-07-03 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. Thanks for doing this! https://reviews.llvm.org/D47537 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bi

[PATCH] D48881: [clangd] Avoid collecting symbols from broken TUs in global-symbol-builder.

2018-07-03 Thread Eric Liu via Phabricator via cfe-commits
ioeric created this revision. ioeric added a reviewer: ilya-biryukov. Herald added subscribers: cfe-commits, jkorous, MaskRay. For example, template parameter might not be resolved in a broken TU, which can result in wrong USR/SymbolID. Repository: rCTE Clang Tools Extra https://reviews.llvm.

[PATCH] D48917: [SemaCodeComplete] Make sure visited contexts are passed to completion results handler.

2018-07-04 Thread Eric Liu via Phabricator via cfe-commits
ioeric created this revision. ioeric added a reviewer: ilya-biryukov. Herald added a subscriber: cfe-commits. Repository: rC Clang https://reviews.llvm.org/D48917 Files: lib/Sema/SemaCodeComplete.cpp unittests/Sema/CodeCompleteTest.cpp Index: unittests/Sema/CodeCompleteTest.cpp ==

[PATCH] D48441: [clangd] Incorporate transitive #includes into code complete proximity scoring.

2018-07-04 Thread Eric Liu via Phabricator via cfe-commits
ioeric added a subscriber: sammccall. ioeric added a comment. Hi Carlos, thanks for letting us know! I sent r336249 to fix the windows test. Repository: rL LLVM https://reviews.llvm.org/D48441 ___ cfe-commits mailing list cfe-commits@lists.llvm.o

[PATCH] D48917: [SemaCodeComplete] Make sure visited contexts are passed to completion results handler.

2018-07-04 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: lib/Sema/SemaCodeComplete.cpp:3744 AddMacroResults(PP, Results, false, PreferredTypeIsPointer); - HandleCodeCompleteResults(this, CodeCompleter, -CodeCompletionContext(CodeCompletionContext::CCC_Expression, ---

[PATCH] D48881: [clangd] Avoid collecting symbols from broken TUs in global-symbol-builder.

2018-07-04 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: clangd/global-symbol-builder/GlobalSymbolBuilderMain.cpp:88 +(CI.getDiagnosticClient().getNumErrors() > 0)) { + llvm::errs() << "Found errors in the translation unit. Igoring " + "collected sy

[PATCH] D48917: [SemaCodeComplete] Make sure visited contexts are passed to completion results handler.

2018-07-04 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 154077. ioeric added a comment. - Addressed review comment. Repository: rC Clang https://reviews.llvm.org/D48917 Files: lib/Sema/SemaCodeComplete.cpp unittests/Sema/CodeCompleteTest.cpp Index: unittests/Sema/CodeCompleteTest.cpp =

[PATCH] D48917: [SemaCodeComplete] Make sure visited contexts are passed to completion results handler.

2018-07-04 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: lib/Sema/SemaCodeComplete.cpp:3744 AddMacroResults(PP, Results, false, PreferredTypeIsPointer); - HandleCodeCompleteResults(this, CodeCompleter, -CodeCompletionContext(CodeCompletionContext::CCC_Expression, ---

[PATCH] D48881: [clangd] Avoid collecting symbols from broken TUs in global-symbol-builder.

2018-07-04 Thread Eric Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL336252: [clangd] Avoid collecting symbols from broken TUs in global-symbol-builder. (authored by ioeric, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews.llv

[PATCH] D48917: [SemaCodeComplete] Make sure visited contexts are passed to completion results handler.

2018-07-04 Thread Eric Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC336255: [SemaCodeComplete] Make sure visited contexts are passed to completion results… (authored by ioeric, committed by ). Changed prior to commit: https://reviews.llvm.org/D48917?vs=154077&id=154080#

[PATCH] D48933: [clangd] Treat class constructor as in the same scope as the class in ranking.

2018-07-04 Thread Eric Liu via Phabricator via cfe-commits
ioeric created this revision. ioeric added a reviewer: sammccall. Herald added subscribers: cfe-commits, jkorous, MaskRay, ilya-biryukov. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D48933 Files: clangd/Quality.cpp unittests/clangd/QualityTests.cpp Index: unittests/clangd

[PATCH] D48938: [clangd] Track origins of symbols (various indexes, Sema).

2018-07-04 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. neat! Comment at: clangd/index/Index.cpp:50 +return OS << "unknown"; + static char Sigils[] = "ADSM4567"; + for (unsigned I = 0; I < sizeof(Sigils); ++I)

[PATCH] D48933: [clangd] Treat class constructor as in the same scope as the class in ranking.

2018-07-05 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 154182. ioeric added a comment. - Refactored findAnyDecl. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D48933 Files: clangd/Quality.cpp unittests/clangd/QualityTests.cpp unittests/clangd/TestTU.cpp unittests/clangd/TestTU.h Index:

[PATCH] D48933: [clangd] Treat class constructor as in the same scope as the class in ranking.

2018-07-05 Thread Eric Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rCTE336318: [clangd] Treat class constructor as in the same scope as the class in ranking. (authored by ioeric, committed by ). Changed prior to commit: https://reviews.llvm.org/D48933?vs=154182&id=154183

[PATCH] D48724: [clangd] Log sema completion context kind and query scopes. NFC

2018-07-05 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 154185. ioeric added a comment. -Rebase Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D48724 Files: clangd/CodeComplete.cpp Index: clangd/CodeComplete.cpp === --- clangd/Cod

[PATCH] D48724: [clangd] Log sema completion context kind and query scopes. NFC

2018-07-05 Thread Eric Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rCTE336321: [clangd] Log sema completion context kind and query scopes. NFC (authored by ioeric, committed by ). Changed prior to commit: https://reviews.llvm.org/D48724?vs=154185&id=154186#toc Repositor

[PATCH] D48961: [Index] Add indexing support for MACROs.

2018-07-05 Thread Eric Liu via Phabricator via cfe-commits
ioeric created this revision. ioeric added reviewers: akyrtzi, arphaman. Herald added a subscriber: cfe-commits. Repository: rC Clang https://reviews.llvm.org/D48961 Files: include/clang/Index/IndexDataConsumer.h include/clang/Index/IndexSymbol.h lib/Index/IndexSymbol.cpp lib/Index/Ind

[PATCH] D48973: [SemaCodeComplete] Expose a method to create CodeCompletionString for macros.

2018-07-05 Thread Eric Liu via Phabricator via cfe-commits
ioeric created this revision. ioeric added a reviewer: sammccall. Herald added a subscriber: cfe-commits. The method only takes PPreprocessor and don't require structures that might not be available (e.g. Sema and ASTContext) when CodeCompletionString needs to be generated for macros. Repository

[PATCH] D48341: [clang-doc] Adding a second reduce pass

2018-07-05 Thread Eric Liu via Phabricator via cfe-commits
ioeric added a comment. Thanks for the refactoring and the comments! They made it a lot easier to understand the changes. I'm focusing on how the changes would fit into the `ToolExecutor` framework in the review and will leave tool-specific logics to another reviewer who I assume would know th

[PATCH] D48961: [Index] Add indexing support for MACROs.

2018-07-06 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 154367. ioeric marked 2 inline comments as done. ioeric added a comment. - Addressed review comments. Expose create a PPCallbacks for indexing macros. Repository: rC Clang https://reviews.llvm.org/D48961 Files: include/clang/Index/IndexDataConsumer.h

[PATCH] D48961: [Index] Add indexing support for MACROs.

2018-07-06 Thread Eric Liu via Phabricator via cfe-commits
ioeric added a comment. Thanks for the review! In https://reviews.llvm.org/D48961#1152999, @sammccall wrote: > I worry this is a trap: the indexing infrastructure here is designed so you > can run it as a frontendaction, on an ASTUnit, or by passing a set of top > level decls. > However the m

[PATCH] D48973: [SemaCodeComplete] Expose a method to create CodeCompletionString for macros.

2018-07-06 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: include/clang/Sema/CodeCompleteConsumer.h:921 bool IncludeBriefComments); + CodeCompletionString * + CreateCodeCompletionStringForMacro(Preprocessor &PP, sammccall wrote: > pl

[PATCH] D48973: [SemaCodeComplete] Expose a method to create CodeCompletionString for macros.

2018-07-06 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 154369. ioeric added a comment. - Addressed review comments. Repository: rC Clang https://reviews.llvm.org/D48973 Files: include/clang/Sema/CodeCompleteConsumer.h lib/Sema/SemaCodeComplete.cpp Index: lib/Sema/SemaCodeComplete.cpp

[PATCH] D48973: [SemaCodeComplete] Expose a method to create CodeCompletionString for macros.

2018-07-06 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 154370. ioeric added a comment. - Merged with orgin/master Repository: rC Clang https://reviews.llvm.org/D48973 Files: include/clang/Sema/CodeCompleteConsumer.h lib/Sema/SemaCodeComplete.cpp Index: lib/Sema/SemaCodeComplete.cpp ==

[PATCH] D48973: [SemaCodeComplete] Expose a method to create CodeCompletionString for macros.

2018-07-06 Thread Eric Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC336427: [SemaCodeComplete] Expose a method to create CodeCompletionString for macros. (authored by ioeric, committed by ). Changed prior to commit: https://reviews.llvm.org/D48973?vs=154370&id=154380#to

[PATCH] D49012: [clangd] Uprank delcarations when "using q::name" is present in the main file

2018-07-06 Thread Eric Liu via Phabricator via cfe-commits
ioeric added a comment. Nice! Just one caveat regarding locations in addition to Sam's comments :) Comment at: clang-tools-extra/clangd/Quality.cpp:48 + if (R.ShadowDecl) { +const auto Loc = SourceMgr.getSpellingLoc(R.ShadowDecl->getLocation()); +if (SourceMgr.isWritt

[PATCH] D48961: [Index] Add indexing support for MACROs.

2018-07-06 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: include/clang/Index/IndexDataConsumer.h:48 /// \returns true to continue indexing, or false to abort. - virtual bool handleMacroOccurence(const IdentifierInfo *Name, -const MacroInfo *MI, SymbolRole

[PATCH] D48961: [Index] Add indexing support for MACROs.

2018-07-06 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 154388. ioeric marked 6 inline comments as done. ioeric added a comment. - addressed review comments. Repository: rC Clang https://reviews.llvm.org/D48961 Files: include/clang/Index/IndexDataConsumer.h include/clang/Index/IndexSymbol.h include/clang

[PATCH] D48961: [Index] Add indexing support for MACROs.

2018-07-06 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 154390. ioeric added a comment. - removed Undefined parameter. Repository: rC Clang https://reviews.llvm.org/D48961 Files: include/clang/Index/IndexDataConsumer.h include/clang/Index/IndexSymbol.h include/clang/Index/IndexingAction.h lib/Index/Ind

[PATCH] D49028: [clangd] Support indexing MACROs.

2018-07-06 Thread Eric Liu via Phabricator via cfe-commits
ioeric created this revision. ioeric added a reviewer: sammccall. Herald added subscribers: cfe-commits, jkorous, MaskRay, ilya-biryukov. This is not enabled in the global-symbol-builder or dynamic index yet. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D49028 Files: clangd/

[PATCH] D49028: [clangd] Support indexing MACROs.

2018-07-06 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 154413. ioeric added a comment. - Some cleanup. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D49028 Files: clangd/index/SymbolCollector.cpp clangd/index/SymbolCollector.h unittests/clangd/SymbolCollectorTests.cpp Index: unittests/cla

[PATCH] D49028: [clangd] Support indexing MACROs.

2018-07-06 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 154414. ioeric added a comment. - Another minor cleanup. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D49028 Files: clangd/index/SymbolCollector.cpp clangd/index/SymbolCollector.h unittests/clangd/SymbolCollectorTests.cpp Index: unit

[PATCH] D48961: [Index] Add indexing support for MACROs.

2018-07-09 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 154543. ioeric marked 2 inline comments as done. ioeric added a comment. - addressed review comments. Repository: rC Clang https://reviews.llvm.org/D48961 Files: include/clang/Index/IndexSymbol.h include/clang/Index/IndexingAction.h lib/Index/IndexS

[PATCH] D48961: [Index] Add indexing support for MACROs.

2018-07-09 Thread Eric Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC336524: [Index] Add indexing support for MACROs. (authored by ioeric, committed by ). Changed prior to commit: https://reviews.llvm.org/D48961?vs=154543&id=154550#toc Repository: rC Clang https://re

[PATCH] D49028: [clangd] Support indexing MACROs.

2018-07-09 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 154559. ioeric marked 5 inline comments as done. ioeric added a comment. - Addressed review comments. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D49028 Files: clangd/index/SymbolCollector.cpp clangd/index/SymbolCollector.h unittests

[PATCH] D49028: [clangd] Support indexing MACROs.

2018-07-09 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: clangd/index/SymbolCollector.cpp:360 + + llvm::SmallString<128> USR; + if (index::generateUSRForMacro(Name.getName(), MI.getDefinitionLoc(), SM, sammccall wrote: > as above, can we avoid generating the USR for every ref

[PATCH] D49028: [clangd] Support indexing MACROs.

2018-07-09 Thread Eric Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rCTE336553: [clangd] Support indexing MACROs. (authored by ioeric, committed by ). Changed prior to commit: https://reviews.llvm.org/D49028?vs=154559&id=154615#toc Repository: rCTE Clang Tools Extra h

[PATCH] D49175: [clangd] Ignore sema code complete callback with recovery context.

2018-07-11 Thread Eric Liu via Phabricator via cfe-commits
ioeric created this revision. ioeric added reviewers: sammccall, ilya-biryukov. Herald added subscribers: cfe-commits, jkorous, MaskRay. Sema code complete in the recovery mode is generally useless. For many cases, sema first completes in recovery context and then recovers to more useful context,

[PATCH] D49175: [clangd] Ignore sema code complete callback with recovery context.

2018-07-11 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 154979. ioeric marked 2 inline comments as done. ioeric added a comment. - Addressed review comments. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D49175 Files: clangd/CodeComplete.cpp unittests/clangd/CodeCompleteTests.cpp Index: uni

[PATCH] D49175: [clangd] Ignore sema code complete callback with recovery context.

2018-07-11 Thread Eric Liu via Phabricator via cfe-commits
ioeric added a comment. In https://reviews.llvm.org/D49175#1158562, @sammccall wrote: > I like this idea, of course hard to know how it will affect all practical > cases. > > Is it easy to get have internal stats on how many wins/losses this has? This would fix bad completion results when sema

[PATCH] D49175: [clangd] Ignore sema code complete callback with recovery context.

2018-07-11 Thread Eric Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL336801: [clangd] Ignore sema code complete callback with recovery context. (authored by ioeric, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews.llvm.org/D49

[PATCH] D48903: [VirtualFileSystem] InMemoryFileSystem::status: Return a Status with the requested name

2018-07-11 Thread Eric Liu via Phabricator via cfe-commits
ioeric added a comment. In https://reviews.llvm.org/D48903#1155403, @ilya-biryukov wrote: > In https://reviews.llvm.org/D48903#1154846, @simark wrote: > > > With the `InMemoryFileSystem`, this now returns a non-real path. The > > result is that we fill `RealPathName` with that non-real path. I

[PATCH] D48903: [VirtualFileSystem] InMemoryFileSystem::status: Return a Status with the requested name

2018-07-11 Thread Eric Liu via Phabricator via cfe-commits
ioeric added a comment. In https://reviews.llvm.org/D48903#1159023, @ioeric wrote: > In https://reviews.llvm.org/D48903#1155403, @ilya-biryukov wrote: > > > In https://reviews.llvm.org/D48903#1154846, @simark wrote: > > > > > With the `InMemoryFileSystem`, this now returns a non-real path. The

[PATCH] D48903: [VirtualFileSystem] InMemoryFileSystem::status: Return a Status with the requested name

2018-07-11 Thread Eric Liu via Phabricator via cfe-commits
ioeric added a comment. In https://reviews.llvm.org/D48903#1159046, @simark wrote: > In https://reviews.llvm.org/D48903#1159023, @ioeric wrote: > > > Would you mind reverting this patch for now so that we can come up with a > > solution to address those use cases? > > > > Sorry again about missi

[PATCH] D49197: FileManager: Try to compute RealPathName in getVirtualFile

2018-07-11 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: lib/Basic/FileManager.cpp:395 + SmallString<128> RealPathName; + if (!FS->getRealPath(InterndFileName, RealPathName)) +UFE->RealPathName = RealPathName.str(); It seems that at this point, we have failed to find `Fil

[PATCH] D48903: [VirtualFileSystem] InMemoryFileSystem::status: Return a Status with the requested name

2018-07-11 Thread Eric Liu via Phabricator via cfe-commits
ioeric added a comment. After looking at a few more use cases of the in-memory file system, I think a problem we need to address is the consistency of file paths you get from clang when using in-mem vfs. The clang-move tests that you have mitigated in https://reviews.llvm.org/D48951 could be a

[PATCH] D49197: FileManager: Try to compute RealPathName in getVirtualFile

2018-07-12 Thread Eric Liu via Phabricator via cfe-commits
ioeric added a comment. In https://reviews.llvm.org/D49197#1158972, @simark wrote: > Background: I'm trying to fix the cases why we receive a FileEntry without a > real path computed in clangd, so we can avoid having to compute it ourselves. I'm curious how you use `getVirtualFile` in your cl

[PATCH] D48903: [VirtualFileSystem] InMemoryFileSystem::status: Return a Status with the requested name

2018-07-12 Thread Eric Liu via Phabricator via cfe-commits
ioeric added a comment. In https://reviews.llvm.org/D48903#1159985, @simark wrote: > In https://reviews.llvm.org/D48903#1159303, @ioeric wrote: > > > For example, suppose you have header search directories > > `-I/path/to/include` and `-I.` in your compile command. When preprocessor > > searche

[PATCH] D48395: Added PublicOnly flag

2018-07-16 Thread Eric Liu via Phabricator via cfe-commits
ioeric added a comment. In https://reviews.llvm.org/D48395#1158869, @juliehockett wrote: > Remember to mark comments as done when they are. Otherwise, LGTM unless > @ioeric has any concerns. No concern if this looks good to Julie. Comment at: clang-tools-extra/test/clang-do

[PATCH] D49421: [CodeComplete] Fix accessibilty of protected members from base class.

2018-07-17 Thread Eric Liu via Phabricator via cfe-commits
ioeric created this revision. ioeric added reviewers: aaron.ballman, sammccall. Herald added a subscriber: cfe-commits. Currently, protected members from base classes are marked as inaccessible when completing in derived class. This patch fixes the problem by setting the naming class correctly whe

[PATCH] D49417: [clangd] Implement trigram generation algorithm for new symbol index

2018-07-18 Thread Eric Liu via Phabricator via cfe-commits
ioeric added a comment. Some high-level comments before jumping into details. Comment at: clang-tools-extra/clangd/index/noctem/SearchAtom.cpp:23 + +// FIXME(kbobyrev): Deal with short symbol symbol names. +std::vector generateSearchAtoms(StringRef SymbolName) { ---

[PATCH] D49476: [Index] Set OrigD before D is changed.

2018-07-18 Thread Eric Liu via Phabricator via cfe-commits
ioeric created this revision. ioeric added reviewers: akyrtzi, arphaman. Herald added a subscriber: cfe-commits. Repository: rC Clang https://reviews.llvm.org/D49476 Files: lib/Index/IndexingContext.cpp Index: lib/Index/IndexingContext.cpp ==

[PATCH] D49421: [CodeComplete] Fix accessibilty of protected members from base class.

2018-07-18 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 156056. ioeric marked 4 inline comments as done. ioeric added a comment. - addressed review comments. Repository: rC Clang https://reviews.llvm.org/D49421 Files: lib/Sema/SemaAccess.cpp lib/Sema/SemaCodeComplete.cpp test/Index/complete-access-checks

[PATCH] D49421: [CodeComplete] Fix accessibilty of protected members from base class.

2018-07-18 Thread Eric Liu via Phabricator via cfe-commits
ioeric added a comment. Thanks for the review! Comment at: lib/Sema/SemaAccess.cpp:1871-1873 +// The access should be AS_none as we don't know how the member was +// accessed - `AccessedEntity::getAccess` describes what access was used to +// access an entity. -

[PATCH] D48341: [clang-doc] Refactoring mapper to map by scope

2018-07-18 Thread Eric Liu via Phabricator via cfe-commits
ioeric added a comment. Map/Reduce change looks good to me. Comment at: clang-tools-extra/test/clang-doc/yaml-record.cpp:44 +// CHECK-0: --- +// CHECK-0-NEXT: USR: '06B5F6A19BA9F6A832E127C9968282B94619B210' +// CHECK-0-NEXT: Name:'C' > Y

[PATCH] D49484: [CodeComplete] Allow getDeclaration on RK_Pattern result.

2018-07-18 Thread Eric Liu via Phabricator via cfe-commits
ioeric created this revision. ioeric added a reviewer: bkramer. Herald added a subscriber: cfe-commits. RK_Pattern results can also have associated declarations e.g. field decls in constructor initializers. Repository: rC Clang https://reviews.llvm.org/D49484 Files: include/clang/Sema/Code

[PATCH] D49484: [CodeComplete] Allow getDeclaration on RK_Pattern result.

2018-07-18 Thread Eric Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL337394: [CodeComplete] Allow getDeclaration on RK_Pattern result. (authored by ioeric, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM https://reviews.llvm.org/D49484 File

[PATCH] D49421: [CodeComplete] Fix accessibilty of protected members from base class.

2018-07-18 Thread Eric Liu via Phabricator via cfe-commits
ioeric updated this revision to Diff 156146. ioeric marked an inline comment as done. ioeric added a comment. - addressed review comments. - Addressed review comments. Repository: rC Clang https://reviews.llvm.org/D49421 Files: lib/Sema/SemaAccess.cpp lib/Sema/SemaCodeComplete.cpp test

[PATCH] D49421: [CodeComplete] Fix accessibilty of protected members from base class.

2018-07-18 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: lib/Sema/SemaAccess.cpp:1871-1873 +// The access should be AS_none as we don't know how the member was +// accessed - `AccessedEntity::getAccess` describes what access was used to +// access an entity. aaron.b

[PATCH] D49476: [Index] Set OrigD before D is changed.

2018-07-19 Thread Eric Liu via Phabricator via cfe-commits
ioeric added a comment. In https://reviews.llvm.org/D49476#1167294, @akyrtzi wrote: > Is it possible to add a regression test case ? I assume this is fixing some > issue, we should make sure we don't regress again. This fixes a downstream use case where we use `OrigD`. AFAICT, `c-index-test`

[PATCH] D49417: [clangd] Implement trigram generation algorithm for new symbol index

2018-07-19 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: clang-tools-extra/clangd/index/noctem/SearchToken.cpp:38 + +// FIXME(kbobyrev): Deal with short symbol symbol names. A viable approach would +// be generating unigrams and bigrams here, too. This would prevent symbol index -

[PATCH] D40399: [clangd] Add missing (but documented!) JSONExpr typed accessors

2017-11-24 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: clangd/JSONExpr.h:368 +// Typed accessors return None/nullptr if the element has the wrong type. +llvm::Optional null(size_t I) const { + return (*this)[I].null(); Why is this needed? `v[x].null()` seems to b

[PATCH] D40406: [clangd] Switch from YAMLParser to JSONExpr

2017-11-24 Thread Eric Liu via Phabricator via cfe-commits
ioeric added inline comments. Comment at: clangd/JSONRPCDispatcher.cpp:221 +Out.log("<-- " + JSONRef + "\n"); +handleAllErrors(Doc.takeError(), [&](const llvm::ErrorInfoBase &Err) { + Out.log(llvm::Twine("JSON parse error: ") + Err.message() + "\n");

[PATCH] D39706: [refactor][extract] Initial implementation of variable captures

2017-11-27 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. Lg (Sorry for losing track of this and the delay!) Repository: rL LLVM https://reviews.llvm.org/D39706 ___ cfe-commits mailing list cfe-commi

[PATCH] D40399: [clangd] Add missing (but documented!) JSONExpr typed accessors

2017-11-28 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 Thanks for the rename! https://reviews.llvm.org/D40399 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bi

[PATCH] D40406: [clangd] Switch from YAMLParser to JSONExpr

2017-11-28 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. lg https://reviews.llvm.org/D40406 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-com

[PATCH] D40548: [clangd] Prototyping index support and naive index-based global code completion. WIP

2017-11-28 Thread Eric Liu via Phabricator via cfe-commits
ioeric created this revision. Herald added subscribers: ilya-biryukov, mgorny. o Experimental interfaces to support use multiple index sources (e.g. AST index, global index) for code completion, cross-reference finding etc. o Replace sema code completion for qualified-id with index-based completio

<    7   8   9   10   11   12   13   14   15   16   >