[PATCH] D55820: [AST] Unify the code paths of traversing lambda expressions.

2018-12-18 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: ilya-biryukov. Herald added a subscriber: arphaman. This supposes to be a non-functional change. We have two code paths when traversing lambda expressions: 1. traverse the function proto typeloc when parameters and return type are explicit;

[PATCH] D55437: [Index] Index declarations in lambda expression.

2018-12-18 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 178660. hokein added a comment. Update the patch. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55437/new/ https://reviews.llvm.org/D55437 Files: lib/Index/IndexBody.cpp test/Index/cxx11-lambdas.cpp Index: test/Index/cx

[PATCH] D55437: [Index] Index declarations in lambda expression.

2018-12-18 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. In D55437#1333145 , @ilya-biryukov wrote: > Update after investigating with @hokein offline: the `RecursiveASTVisitor` > has custom code to visit lambda parameters and return type, but it fallback > to visiting typelocs when both

[PATCH] D55820: [AST] Unify the code paths of traversing lambda expressions.

2018-12-18 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 178667. hokein marked an inline comment as done. hokein added a comment. Fix the format. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55820/new/ https://reviews.llvm.org/D55820 Files: include/clang/AST/RecursiveASTVisitor.

[PATCH] D55820: [AST] Unify the code paths of traversing lambda expressions.

2018-12-18 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: include/clang/AST/RecursiveASTVisitor.h:2416 FunctionProtoTypeLoc Proto = TL.getAsAdjusted(); + if (S->hasExplicitParameters()) { ilya-biryukov wrote: > Could we add a comment on why we can't simply call the `Traver

[PATCH] D55820: [AST] Unify the code paths of traversing lambda expressions.

2018-12-18 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC349494: [AST] Unify the code paths of traversing lambda expressions. (authored by hokein, committed by ). Changed prior to commit: https://reviews.llvm.org/D55820?vs=178667&id=178674#toc Repository:

[PATCH] D55437: [Index] Index declarations in lambda expression.

2018-12-18 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 178687. hokein added a comment. Rebase and simplify the test. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55437/new/ https://reviews.llvm.org/D55437 Files: lib/Index/IndexBody.cpp test/Index/cxx11-lambdas.cpp Index: t

[PATCH] D55437: [Index] Index declarations in lambda expression.

2018-12-18 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 178688. hokein marked an inline comment as done. hokein added a comment. Fix a nit. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55437/new/ https://reviews.llvm.org/D55437 Files: lib/Index/IndexBody.cpp test/Index/cxx11-

[PATCH] D55848: [clang-tidy] Add export-fixes flag to clang-tidy-diff

2018-12-19 Thread Haojian Wu via Phabricator via cfe-commits
hokein accepted this revision. hokein added a comment. This revision is now accepted and ready to land. looks good. Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55848/new/ https://reviews.llvm.org/D55848 _

[PATCH] D55437: [Index] Index declarations in lambda expression.

2018-12-19 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC349626: [Index] Index paremeters in lambda expressions. (authored by hokein, committed by ). Changed prior to commit: https://reviews.llvm.org/D55437?vs=178688&id=178870#toc Repository: rC Clang CHA

[PATCH] D55918: [clangd] Don't miss the expected type in merge.

2018-12-20 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: ilya-biryukov. Herald added subscribers: kadircet, arphaman, jkorous, MaskRay, ioeric. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D55918 Files: clangd/index/Merge.cpp unittests/clangd/IndexTests.cpp Index: unittests/

[PATCH] D55363: [clangd] Expose FileStatus in LSP.

2018-12-20 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 179041. hokein marked 3 inline comments as done. hokein added a comment. address review comments. Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55363/new/ https://reviews.llvm.org/D55363 Files: clangd/ClangdLS

[PATCH] D55363: [clangd] Expose FileStatus in LSP.

2018-12-20 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. In D55363#1336315 , @ilya-biryukov wrote: > Could we add a capability to the init request to check for this extension? We > don't want to send those notifications to clients that don't have the code to > handle them. yes, I thi

[PATCH] D55918: [clangd] Don't miss the expected type in merge.

2018-12-20 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL349750: [clangd] Don't miss the expected type in merge. (authored by hokein, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM CHANGES SINCE LAST ACTION https://reviews.llv

[PATCH] D55363: [clangd] Expose FileStatus in LSP.

2018-12-20 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 179046. hokein marked 4 inline comments as done. hokein added a comment. Remove details. Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55363/new/ https://reviews.llvm.org/D55363 Files: clangd/ClangdLSPServer.c

[PATCH] D55363: [clangd] Expose FileStatus in LSP.

2018-12-20 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 179047. hokein added a comment. Rebase Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55363/new/ https://reviews.llvm.org/D55363 Files: clangd/ClangdLSPServer.cpp clangd/ClangdLSPServer.h clangd/Protocol.cp

[PATCH] D55363: [clangd] Expose FileStatus in LSP.

2018-12-20 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clangd/index/Merge.cpp:137 S.ReturnType = O.ReturnType; + if (S.Type == "") +S.Type = O.Type; ilya-biryukov wrote: > Accidental change? oops, I rebased this branch on top of my another branch. Fixed. Repositor

[PATCH] D55363: [clangd] Expose FileStatus in LSP.

2018-12-20 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rCTE349768: [clangd] Expose FileStatus to LSP. (authored by hokein, committed by ). Changed prior to commit: https://reviews.llvm.org/D55363?vs=179047&id=179080#toc Repository: rCTE Clang Tools Extra

[PATCH] D55374: [clangd] Show FileStatus in vscode-clangd.

2018-12-20 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 179082. hokein added a comment. Update the patch to reflect LSP file status latest change. Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55374/new/ https://reviews.llvm.org/D55374 Files: clangd/clients/clangd-

[PATCH] D55374: [clangd] Show FileStatus in vscode-clangd.

2018-12-20 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. The patch is ready for review now. Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D55374/new/ https://reviews.llvm.org/D55374 ___ cfe-commits mailing list cfe-commits@lists.llvm.or

[PATCH] D55994: [clangd] Check preceding char when completion triggers on ':' or '>'

2019-01-02 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. The code looks mostly good to me. Comment at: clangd/ClangdLSPServer.cpp:789 +bool ClangdLSPServer::isSporadicCompletion( +const CompletionParams &Params) const { The method name is a bit confusing to me, I didn't get its meaning a

[PATCH] D55374: [clangd] Show FileStatus in vscode-clangd.

2019-01-02 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL350210: [clangd] Show FileStatus in vscode-clangd. (authored by hokein, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM CHANGES SINCE LAST ACTION https://reviews.llvm.org

[PATCH] D55994: [clangd] Check preceding char when completion triggers on ':' or '>'

2019-01-02 Thread Haojian Wu via Phabricator via cfe-commits
hokein accepted this revision. hokein added inline comments. This revision is now accepted and ready to land. Comment at: clangd/ClangdLSPServer.cpp:811 + if (Trigger == ">") +return (*Code)[*Offset - 2] != '-'; // trigger only on '->'. + if (Trigger == ":") ---

[PATCH] D55994: [clangd] Check preceding char when completion triggers on ':' or '>'

2019-01-03 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. In D55994#1343669 , @jkorous wrote: > This looks like a work around LSP imperfection indeed. > > Are you going to push for change in LSP? Something like > `CompletionOptions/triggerCharacters` -> `CompletionOptions/triggerStrings`?

[PATCH] D56314: [clangd] Don't store completion info if the symbol is not used for code completion.

2019-01-04 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. Herald added subscribers: cfe-commits, kadircet, arphaman, jkorous, MaskRay, ioeric, ilya-biryukov. This would save us some memory and disk space: - Dex usage (269 MB vs 278 MB) - Disk (73 MB vs 76 MB) It would save more when we index the main file symbol. Reposi

[PATCH] D56380: [clangd] Fix a regression issue caused by r348365.

2019-01-07 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: ilya-biryukov. Herald added subscribers: kadircet, arphaman, jkorous, MaskRay, ioeric. With r348365, we now detect libc++ dir using the actual compiler path (from the compilation command), rather than the resource-dir. This new behavior will

[PATCH] D56380: [clangd] Fix a regression issue caused by r348365.

2019-01-07 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rCTE350515: [clangd] Fix a regression issue caused by r348365. (authored by hokein, committed by ). Changed prior to commit: https://reviews.llvm.org/D56380?vs=180447&id=180460#toc Repository: rCTE Cla

[PATCH] D56314: [clangd] Don't store completion info if the symbol is not used for code completion.

2019-01-07 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. In D56314#1347964 , @ilya-biryukov wrote: > @hokein, do you need reviewers for this? I'm happy to volunteer. Thanks. > In D56314#1347511 , @nridge wrote: > >> Might we want to keep some

[PATCH] D56424: [clang-tidy] Add check for underscores in googletest names.

2019-01-08 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. Thanks, mostly good to me. just a few nits. Comment at: clang-tidy/google/AvoidUnderscoreInGoogletestNameCheck.cpp:72 +TestName.consume_front(kDisabledTestPrefix); +if (TestName.find('_') != std::string::npos) { + Check->diag(TestNameToken->

[PATCH] D56314: [clangd] Don't store completion info if the symbol is not used for code completion.

2019-01-08 Thread Haojian Wu via Phabricator via cfe-commits
hokein marked an inline comment as done. hokein added inline comments. Comment at: clangd/index/SymbolCollector.cpp:543 + + if (!(S.Flags & Symbol::IndexedForCodeCompletion)) +return Insert(S); ilya-biryukov wrote: > Most of the fields updated at the bottom

[PATCH] D56442: [clangd] Fix a crash when reading an empty index file.

2019-01-08 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: ilya-biryukov. Herald added subscribers: kadircet, arphaman, jkorous, MaskRay, ioeric. Unfortunately, yaml::Input::setCurrentDocument() and yaml::Input::nextDocument() are internal APIs, the way we use them may cause a nullptr accessing when

[PATCH] D56442: [clangd] Fix a crash when reading an empty index file.

2019-01-08 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. In D56442#1349666 , @ilya-biryukov wrote: > LGTM. Thanks for fixing this. > > A few questions for the long-term: > > - Should we consider removing the YAML support altogether? The motivation of the YAML is for debugging purpose (

[PATCH] D56442: [clangd] Fix a crash when reading an empty index file.

2019-01-08 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL350633: [clangd] Fix a crash when reading an empty index file. (authored by hokein, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM CHANGES SINCE LAST ACTION https://revi

[PATCH] D56483: [clangd] Add a test for SignatureHelp on dynamic index.

2019-01-09 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: ilya-biryukov. Herald added subscribers: kadircet, arphaman, jkorous, MaskRay, ioeric. This would catch regressions caused by future changes of the index. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D56483 Files: unitte

[PATCH] D56314: [clangd] Don't store completion info if the symbol is not used for code completion.

2019-01-09 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 180808. hokein marked 2 inline comments as done. hokein added a comment. Address comments, store docs. Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56314/new/ https://reviews.llvm.org/D56314 Files: clangd/ind

[PATCH] D56314: [clangd] Don't store completion info if the symbol is not used for code completion.

2019-01-09 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clangd/index/SymbolCollector.cpp:543 + + if (!(S.Flags & Symbol::IndexedForCodeCompletion)) +return Insert(S); ilya-biryukov wrote: > hokein wrote: > > ilya-biryukov wrote: > > > Most of the fields updated at the bot

[PATCH] D56424: [clang-tidy] Add check for underscores in googletest names.

2019-01-09 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-tidy/google/AvoidUnderscoreInGoogletestNameCheck.cpp:27 +static bool isGoogletestTestMacro(StringRef MacroName) { + static const llvm::StringSet<> MacroNames = {"TEST", "TEST_F", "TEST_P", +

[PATCH] D56483: [clangd] Add a test for SignatureHelp on dynamic index.

2019-01-09 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL350720: [clangd] Add a test for SignatureHelp on dynamic index. (authored by hokein, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM CHANGES SINCE LAST ACTION https://rev

[PATCH] D56314: [clangd] Don't store completion info if the symbol is not used for code completion.

2019-01-09 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 180827. hokein marked an inline comment as done. hokein added a comment. address review comments Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56314/new/ https://reviews.llvm.org/D56314 Files: clangd/index/Ind

[PATCH] D56492: [clangd] Add Documentations for member completions.

2019-01-09 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: ilya-biryukov. Herald added subscribers: kadircet, arphaman, jkorous, MaskRay, ioeric. We are missing docs for class member completion -- we don't store comments in the preamble, so Sema doesn't return any docs. To get docs for class members,

[PATCH] D56492: [clangd] Add Documentations for member completions.

2019-01-09 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 180843. hokein added a comment. Add a comment. Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56492/new/ https://reviews.llvm.org/D56492 Files: clangd/CodeComplete.cpp unittests/clangd/CodeCompleteTests.cpp

[PATCH] D56314: [clangd] Don't store completion info if the symbol is not used for code completion.

2019-01-09 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. In D56314#1351091 , @ilya-biryukov wrote: > LGTM again :-) I bet the savings are less now that we're always storing the > comments in the static index, so the numbers in the description might be > outdated. Yes, fixed. Reposi

[PATCH] D56314: [clangd] Don't store completion info if the symbol is not used for code completion.

2019-01-10 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL350803: [clangd] Don't store completion info if the symbol is not used for code… (authored by hokein, committed by ). Herald added a subscriber: llvm-commits. Repository: rL LLVM CHANGES SINCE LAST ACT

[PATCH] D56492: [clangd] Add Documentations for member completions.

2019-01-10 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 181009. hokein marked 3 inline comments as done. hokein added a comment. Address comments. Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56492/new/ https://reviews.llvm.org/D56492 Files: clangd/CodeComplete.cp

[PATCH] D56539: [clangd] Drop documentation in static index if symbols are not indexed for completion.

2019-01-10 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: ilya-biryukov. Herald added subscribers: kadircet, arphaman, jkorous, MaskRay, ioeric. This is a further optimization of r350803, we drop docs in static index for symbols not being indexed for completion, while keeping the docs in dynamic inde

[PATCH] D56540: [clangd] Clean the cache of file statuses on vscode-clangd when clangd crashes.

2019-01-10 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: ilya-biryukov. Herald added subscribers: kadircet, arphaman, jkorous, MaskRay, ioeric. Clear the cached file statuses, otherwise We will leave some garbage texts on the status bar when clangd crashes. Repository: rCTE Clang Tools Extra ht

[PATCH] D67135: [clang-tidy] performance-inefficient-vector-operation: Support proto repeated field

2019-09-10 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-tools-extra/clang-tidy/performance/InefficientVectorOperationCheck.cpp:227 +std::string MutableFieldName = +("mutable_" + ProtoAddFieldCall->getMethodDecl()->getName().substr(4)) +.str(); co

[PATCH] D67341: [clangd] Simplify semantic highlighting visitor

2019-09-10 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. thanks, looks good, just a few nits. Comment at: clang-tools-extra/clangd/SemanticHighlighting.cpp:34 +return true; + if (!Name.isIdentifier()) +return false; nit: I think the check is redundant, getAsIdentifierInfo() will retur

[PATCH] D67264: [clangd] Collect location of macro definition in the ParsedAST

2019-09-10 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 219501. hokein marked an inline comment as done. hokein added a comment. address comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67264/new/ https://reviews.llvm.org/D67264 Files: clang-tools-extra/clan

[PATCH] D67264: [clangd] Collect location of macro definition in the ParsedAST

2019-09-10 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. In D67264#1663285 , @ilya-biryukov wrote: > LGTM. > > We should probably also take a look at highlighting macros inside the > preamble part of the main file. > @hokein, are you planning to do this or should we just file a bug for

[PATCH] D67264: [clangd] Collect location of macro definition in the ParsedAST

2019-09-10 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL371504: [clangd] Collect location of macro definition in the ParsedAST (authored by hokein, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed prior to commit:

[PATCH] D67391: Copy llvm .gitattributes to the monorepository.

2019-09-10 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: gribozavr. Herald added a project: LLVM. Herald added a subscriber: llvm-commits. This will fix the git "modified" change of llvm/trunk/test/MC/AsmParser/preserve-comments-crlf.s on linux. Repository: rG LLVM Github Monorepo https://revi

[PATCH] D67391: Copy llvm .gitattributes to the monorepository.

2019-09-10 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 219522. hokein added a comment. Update the patch. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67391/new/ https://reviews.llvm.org/D67391 Files: llvm/.gitattributes Index: llvm/.gitattributes =

[PATCH] D67391: Fix the "git modified" issue on the preserve-comments-crlf.s.

2019-09-10 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL371513: Fix the "git modified" issue on the preserve-comments-crlf.s. (authored by hokein, committed by ). Changed prior to commit: https://reviews.llvm.org/D67391?vs=219522&id=219525#toc Repository:

[PATCH] D67135: [clang-tidy] performance-inefficient-vector-operation: Support proto repeated field

2019-09-11 Thread Haojian Wu via Phabricator via cfe-commits
hokein accepted this revision. hokein added a comment. This revision is now accepted and ready to land. thanks, looks good. Comment at: clang-tools-extra/test/clang-tidy/performance-inefficient-vector-operation.cpp:315 +foo.mutable_x(); +// CHECK-FIXES-NOT: foo.mutable

[PATCH] D67496: [clangd] Collect macros in the preamble region of the main file

2019-09-12 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: ilya-biryukov. Herald added subscribers: kadircet, arphaman, mgrang, jkorous, MaskRay. Herald added a project: clang. - store all macro references in the ParsedAST, which also helps to implement find references for macros. - unify the two var

[PATCH] D67496: [clangd] Collect macros in the preamble region of the main file

2019-09-12 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 219904. hokein added a comment. some cleanup Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67496/new/ https://reviews.llvm.org/D67496 Files: clang-tools-extra/clangd/CodeComplete.cpp clang-tools-extra/clang

[PATCH] D67135: [clang-tidy] performance-inefficient-vector-operation: Support proto repeated field

2019-09-13 Thread Haojian Wu via Phabricator via cfe-commits
hokein accepted this revision. hokein added a comment. feel free to commit the patch. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67135/new/ https://reviews.llvm.org/D67135 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://l

[PATCH] D67607: [clangd] Fix a crash when renaming operator.

2019-09-16 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 220289. hokein added a comment. Fix an accident change. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67607/new/ https://reviews.llvm.org/D67607 Files: clang-tools-extra/clangd/refactor/Rename.cpp clang-too

[PATCH] D67607: [clangd] Fix a crash when renaming operator.

2019-09-16 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: ilya-biryukov. Herald added subscribers: kadircet, arphaman, jkorous, MaskRay. Herald added a project: clang. hokein retitled this revision from "clangd] Fix a crash when renaming operator." to "[clangd] Fix a crash when renaming operator.". h

[PATCH] D67135: [clang-tidy] performance-inefficient-vector-operation: Support proto repeated field

2019-09-16 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL371963: [clang-tidy] performance-inefficient-vector-operation: Support proto repeated… (authored by hokein, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed

[PATCH] D67135: [clang-tidy] performance-inefficient-vector-operation: Support proto repeated field

2019-09-16 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. In D67135#1669836 , @congliu wrote: > Could someone commit this for me? I failed to commit this change... Committed in rL371963 , just curious why you failed to commit? if you are using llvm git

[PATCH] D67607: [clangd] Fix a crash when renaming operator.

2019-09-16 Thread Haojian Wu via Phabricator via cfe-commits
hokein marked 2 inline comments as done. hokein added inline comments. Comment at: clang-tools-extra/clangd/refactor/Rename.cpp:77 return ReasonToReject::UnsupportedSymbol; + if (const auto *FD = llvm::dyn_cast(&RenameDecl)) { +if (FD->isOverloadedOperator()) --

[PATCH] D67607: [clangd] Fix a crash when renaming operator.

2019-09-16 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. hokein marked an inline comment as done. Closed by commit rGaf28bb65023e: [clangd] Fix a crash when renaming operator. (authored by hokein). Herald added a subscriber: usaxena95. Repository: rG LLVM Github Monorepo CHANG

[PATCH] D67650: [clangd] Add SemanticRanges to Clangd server.

2019-09-17 Thread Haojian Wu via Phabricator via cfe-commits
hokein accepted this revision. hokein added a comment. This revision is now accepted and ready to land. Thanks! looks good. I think next step is to implement it in the LSP layer. Comment at: clang-tools-extra/clangd/unittests/SemanticSelectionTests.cpp:161 + )cpp"; + Annotati

[PATCH] D67651: [clangd] No ExtractFunction on empty selections.

2019-09-17 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: kadircet. Herald added subscribers: usaxena95, arphaman, jkorous, MaskRay, ilya-biryukov. Herald added a project: clang. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D67651 Files: clang-tools-extra/clangd/refactor/tweaks/

[PATCH] D67654: [clang-tidy] Fix a potential infinite loop in readability-isolate-declaration check.

2019-09-17 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: ilya-biryukov. Herald added a subscriber: xazax.hun. Herald added a project: clang. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D67654 Files: clang-tools-extra/clang-tidy/utils/LexerUtils.h clang-tools-extra/test/clan

[PATCH] D67651: [clangd] No ExtractFunction on empty selections.

2019-09-17 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. In D67651#1672403 , @kadircet wrote: > this one is actually specific to vardecl's and has a pending fix in D66872 > > > I would rather wait for it to land, instead of adding another branch. WDYT?

[PATCH] D67695: [clangd] Implement getBeginning for overloaded operators.

2019-09-18 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: ilya-biryukov. Herald added subscribers: usaxena95, kadircet, arphaman, jkorous, MaskRay. Herald added a project: clang. hokein marked an inline comment as done. hokein added inline comments. Comment at: clang-tools-extra/cla

[PATCH] D67695: [clangd] Implement getBeginning for overloaded operators.

2019-09-18 Thread Haojian Wu via Phabricator via cfe-commits
hokein marked an inline comment as done. hokein added inline comments. Comment at: clang-tools-extra/clangd/SourceCode.cpp:256 + SourceLocation getBeginningOfIdentifier(const Position &Pos, const SourceManager &SM, the fu

[PATCH] D67654: [clang-tidy] Fix a potential infinite loop in readability-isolate-declaration check.

2019-09-18 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 220627. hokein marked 2 inline comments as done. hokein added a comment. Handle the eof corner case. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67654/new/ https://reviews.llvm.org/D67654 Files: clang-tools

[PATCH] D67654: [clang-tidy] Fix a potential infinite loop in readability-isolate-declaration check.

2019-09-18 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. > Do we have unit tests for clang-tidy? If yes, could we also add unit-tests > for this function? > The modified function only needs a source manager and lang options, these > are easy to mock. Unfortunately, we don't have any unit tests for all these utility functions.

[PATCH] D67654: [clang-tidy] Fix a potential infinite loop in readability-isolate-declaration check.

2019-09-18 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL372206: [clang-tidy] Fix a potential infinite loop in readability-isolate-declaration… (authored by hokein, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed p

[PATCH] D65433: [clangd] DefineInline action availability checks

2019-09-18 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-tools-extra/clangd/refactor/tweaks/DefineInline.cpp:65 +const FunctionDecl *getSelectedFunction(const SelectionTree::Node *SelNode) { + const ast_type_traits::DynTypedNode &AstNode = SelNode->ASTNode; + if (const FunctionDecl *FD

[PATCH] D67720: [clangd] Add semantic selection to ClangdLSPServer.

2019-09-19 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. I think we're missing the client/server capability implementation in this patch, we should include them. Comment at: clang-tools-extra/clangd/ClangdLSPServer.cpp:1131 +Callback> Reply) { + if (Params.positions.size() != 1) { +elog("{0} position

[PATCH] D65433: [clangd] DefineInline action availability checks

2019-09-20 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. mostly good to me, a few more comments. Comment at: clang-tools-extra/clangd/refactor/tweaks/DefineInline.cpp:183 +/// a.h: +/// void foo() { return ; } +/// kadircet wrote: > hokein wrote: > > now we get a potential ODR violation in t

[PATCH] D67748: [clangd] Add a helper for extracting nonlocal decls in a FunctionDecl

2019-09-20 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. I think the helper is only used by the defineInline tweak? not sure XRef.h is the best place for putting these helpers. Will we have more helpers in the future? If so, we may put them all in a new file. Comment at: clang-tools-extra/clangd/unittests/XR

[PATCH] D67496: [clangd] Collect macros in the preamble region of the main file

2019-09-23 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. Herald added a subscriber: usaxena95. friendly ping, in case you missing it :) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67496/new/ https://reviews.llvm.org/D67496 ___ cfe-c

[PATCH] D67907: [clangd] Implement a smart version of HeaderSource switch.

2019-09-23 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 221288. hokein added a comment. Cleanup. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67907/new/ https://reviews.llvm.org/D67907 Files: clang-tools-extra/clangd/CMakeLists.txt clang-tools-extra/clangd/Clan

[PATCH] D67907: [clangd] Implement a smart version of HeaderSource switch.

2019-09-23 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: kadircet. Herald added subscribers: usaxena95, arphaman, jkorous, MaskRay, ilya-biryukov, mgorny. Herald added a project: clang. hokein updated this revision to Diff 221288. hokein added a comment. Cleanup. This patch implements another ver

[PATCH] D65433: [clangd] DefineInline action availability checks

2019-09-23 Thread Haojian Wu via Phabricator via cfe-commits
hokein accepted this revision. hokein added a comment. This revision is now accepted and ready to land. looks good with a few nits. Comment at: clang-tools-extra/clangd/refactor/tweaks/DefineInline.cpp:183 +/// a.h: +/// void foo() { return ; } +/// kadircet

[PATCH] D67748: [clangd] Add a helper for extracting nonlocal decls in a FunctionDecl

2019-09-23 Thread Haojian Wu via Phabricator via cfe-commits
hokein accepted this revision. hokein added a comment. This revision is now accepted and ready to land. I think in the future (after https://reviews.llvm.org/D67826), we can use the `findExplicitReferences` to implement it. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION http

[PATCH] D67496: [clangd] Collect macros in the preamble region of the main file

2019-09-23 Thread Haojian Wu via Phabricator via cfe-commits
hokein marked an inline comment as done. hokein added inline comments. Comment at: clang-tools-extra/clangd/Macro.h:59 + +if (auto Range = getTokenRange(SM, LangOpts, MacroNameTok.getLocation())) { + MainFileMacros.push_back( ilya-biryukov wrote: > Conve

[PATCH] D67901: [clangd] Improve semantic highlighting in dependent contexts (fixes #154)

2019-09-23 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. The heuristic of guessing a concrete type seems fragile, and may not work for all cases. Instead of trying out test to guess the underlying type, I think we could introduce a new highlighting kind (e.g. `entity.name.type.dependent`) for this. Comment

[PATCH] D67916: [clangd] Simplify the callside of URI::resolve, NFC.

2019-09-23 Thread Haojian Wu via Phabricator via cfe-commits
hokein created this revision. hokein added a reviewer: kadircet. Herald added subscribers: usaxena95, arphaman, jkorous, MaskRay, ilya-biryukov. Herald added a project: clang. - Add a overrloded URI::resolve, which accepts a string URI; - also fixed some callside that don't check the error; Repo

[PATCH] D67916: [clangd] Simplify the callside of URI::resolve, NFC.

2019-09-23 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 221320. hokein added a comment. remove an accident change. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67916/new/ https://reviews.llvm.org/D67916 Files: clang-tools-extra/clangd/CodeComplete.cpp clang-too

[PATCH] D67916: [clangd] Simplify the callside of URI::resolve, NFC.

2019-09-23 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 221326. hokein marked 7 inline comments as done. hokein added a comment. address comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67916/new/ https://reviews.llvm.org/D67916 Files: clang-tools-extra/cla

[PATCH] D67916: [clangd] Simplify the callside of URI::resolve, NFC.

2019-09-23 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-tools-extra/clangd/FindSymbols.cpp:48 if (!Path) { return llvm::make_error( +formatv("Could not resolve path for URI '{0}' for symbol '{1}': {2}", kadircet wrote: > `return make_string_error(...` ? >

[PATCH] D67916: [clangd] Simplify the callside of URI::resolve, NFC.

2019-09-23 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL372617: [clangd] Simplify the callside of URI::resolve, NFC. (authored by hokein, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed prior to commit: https://

[PATCH] D67907: [clangd] Implement a smart version of HeaderSource switch.

2019-09-24 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-tools-extra/clangd/HeaderSourceSwitch.cpp:21 +// file. +class CollectIndexableLocalDecls { +public: kadircet wrote: > this class doesn't seem to have any state(apart from saving AST in > constructor and using it in

[PATCH] D67907: [clangd] Implement a smart version of HeaderSource switch.

2019-09-24 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 221486. hokein marked 4 inline comments as done. hokein added a comment. Address comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67907/new/ https://reviews.llvm.org/D67907 Files: clang-tools-extra/cla

[PATCH] D67496: [clangd] Collect macros in the preamble region of the main file

2019-09-24 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 221492. hokein marked 2 inline comments as done. hokein added a comment. Address comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67496/new/ https://reviews.llvm.org/D67496 Files: clang-tools-extra/cla

[PATCH] D67496: [clangd] Collect macros in the preamble region of the main file

2019-09-24 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-tools-extra/clangd/Macro.h:67 + bool InMainFile = true; + std::vector &MainFileMacros; +}; ilya-biryukov wrote: > hokein wrote: > > ilya-biryukov wrote: > > > Could we model in a way that avoids duplicating macro

[PATCH] D67496: [clangd] Collect macros in the preamble region of the main file

2019-09-24 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 221501. hokein marked 10 inline comments as done. hokein added a comment. Address review comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67496/new/ https://reviews.llvm.org/D67496 Files: clang-tools-e

[PATCH] D67720: [clangd] Add semantic selection to ClangdLSPServer.

2019-09-24 Thread Haojian Wu via Phabricator via cfe-commits
hokein added a comment. In D67720#1680460 , @usaxena95 wrote: > I am not sure adding client capability is useful here. I have not used the > client capability for selectionRange anywhere and I think we can remove it. > WDYT ? The `SelectionRangeClient

[PATCH] D67496: [clangd] Collect macros in the preamble region of the main file

2019-09-24 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 221504. hokein added a comment. update header guard. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67496/new/ https://reviews.llvm.org/D67496 Files: clang-tools-extra/clangd/CodeComplete.cpp clang-tools-ext

[PATCH] D67496: [clangd] Collect macros in the preamble region of the main file

2019-09-24 Thread Haojian Wu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL372725: [clangd] Collect macros in the preamble region of the main file (authored by hokein, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed prior to commit:

[PATCH] D66937: [clangd] Fix the stale documentation about background indexing.

2019-09-24 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 221508. hokein marked 8 inline comments as done. hokein added a comment. Herald added a subscriber: usaxena95. Address comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D66937/new/ https://reviews.llvm.org/

[PATCH] D66937: [clangd] Fix the stale documentation about background indexing.

2019-09-24 Thread Haojian Wu via Phabricator via cfe-commits
hokein updated this revision to Diff 221509. hokein added a comment. fix a typo Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D66937/new/ https://reviews.llvm.org/D66937 Files: clang-tools-extra/docs/clangd/Installation.rst Index: clang-tools-e

[PATCH] D66937: [clangd] Fix the stale documentation about background indexing.

2019-09-24 Thread Haojian Wu via Phabricator via cfe-commits
hokein added inline comments. Comment at: clang-tools-extra/docs/clangd/Installation.rst:363 -- Pass an experimental `-background-index` command line argument. With - this feature enabled, clangd incrementally builds an index of projects - that you work on and uses the just-

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