[PATCH] D67826: [clangd] A helper to find explicit references and their names

2019-09-23 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet added inline comments. Comment at: clang-tools-extra/clangd/FindTarget.h:115 +/// FIXME: extend to report location information about declaration names too. +void findExplicitReferences(Stmt *S, +llvm::function_ref Out); It mig

[PATCH] D67826: [clangd] A helper to find explicit references and their names

2019-09-23 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet added inline comments. Comment at: clang-tools-extra/clangd/FindTarget.h:93 + /// in 'obj.foo'. + const Expr* MemberExprBase = nullptr; +}; do we have any real use-case for this field? apart from "skipping instance members in define inline"? because t

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

2019-09-23 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet accepted this revision. kadircet added a comment. This revision is now accepted and ready to land. LGTM, thanks! Comment at: clang-tools-extra/clangd/FindSymbols.cpp:48 if (!Path) { return llvm::make_error( +formatv("Could not resolve path for URI '{0}'

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

2019-09-23 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet requested changes to this revision. kadircet added inline comments. This revision now requires changes to proceed. Comment at: clang-tools-extra/clangd/index/BackgroundIndexLoader.cpp:30 + if (!AbsolutePath) { +elog("Failed to resolve URI {0}:", URI, AbsolutePath.ta

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

2019-09-23 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet accepted this revision. kadircet added a comment. This revision is now accepted and ready to land. LGTM, thanks! Comment at: clang-tools-extra/clangd/FindSymbols.cpp:48 if (!Path) { return llvm::make_error( +formatv("Could not resolve path for URI '{0}'

[PATCH] D67826: [clangd] A helper to find explicit references and their names

2019-09-24 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet marked an inline comment as done. kadircet added inline comments. Comment at: clang-tools-extra/clangd/FindTarget.cpp:376 + + // We prefer to return template instantiation, but fallback to template + // pattern if instantiation is not available. ilya-b

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

2019-09-24 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet 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 jus

[PATCH] D67826: [clangd] A helper to find explicit references and their names

2019-09-24 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet marked 4 inline comments as done. kadircet added inline comments. Comment at: clang-tools-extra/clangd/FindTarget.h:96 +}; +llvm::raw_ostream &operator<<(llvm::raw_ostream &OS, ReferenceLoc R); + ilya-biryukov wrote: > kadircet wrote: > > Is this for tes

[PATCH] D67826: [clangd] A helper to find explicit references and their names

2019-09-25 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet accepted this revision. kadircet added a comment. This revision is now accepted and ready to land. LGTM, thanks! Comment at: clang-tools-extra/clangd/FindTarget.h:103 +llvm::function_ref Out); +void findExplicitReferences(Decl *S, +

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

2019-09-25 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet accepted this revision. kadircet added a comment. This revision is now accepted and ready to land. thanks, lgtm! Comment at: clang-tools-extra/docs/clangd/Installation.rst:364 + amount of cores by passing the `-j=` flag; +- the index is saved to the ``.clangd/index``

[PATCH] D67960: [clangd] Move the existing heder-source-switch implemenation out of clangdServer.

2019-09-25 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet accepted this revision. kadircet added a comment. This revision is now accepted and ready to land. thanks, lgtm! Comment at: clang-tools-extra/clangd/HeaderSourceSwitch.cpp:21 +llvm::IntrusiveRefCntPtr VFS) { + // FIXME: move the file heuristic to HeaderSourceSwit

[PATCH] D68020: [clangd] Fix parseNamespaceEvents to parse the last token

2019-09-25 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet created this revision. kadircet added reviewers: hokein, ilya-biryukov. Herald added subscribers: cfe-commits, usaxena95, arphaman, jkorous, MaskRay. Herald added a project: clang. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D68020 Files: clang-tools-extra/clangd/So

[PATCH] D68020: [clangd] Fix parseNamespaceEvents to parse the last token

2019-09-25 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet updated this revision to Diff 221759. kadircet added a comment. - Add empty string testcase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68020/new/ https://reviews.llvm.org/D68020 Files: clang-tools-extra/clangd/SourceCode.cpp clang-

[PATCH] D68020: [clangd] Fix parseNamespaceEvents to parse the last token

2019-09-25 Thread Kadir Cetinkaya via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL372875: [clangd] Fix parseNamespaceEvents to parse the last token (authored by kadircet, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed prior to commit: h

[PATCH] D68024: [clangd] Implement GetEligibleRegions

2019-09-25 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet created this revision. kadircet added reviewers: hokein, ilya-biryukov. Herald added subscribers: cfe-commits, usaxena95, arphaman, jkorous, MaskRay. Herald added a project: clang. This is an helper for incoming move definition out-of-line action to figure out possible insertion locations

[PATCH] D68027: [clangd] Change constness of parameters to findExplicitRefs

2019-09-25 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet created this revision. kadircet added a reviewer: ilya-biryukov. Herald added subscribers: cfe-commits, usaxena95, arphaman, jkorous, MaskRay. Herald added a project: clang. Recursive AST requires non-const ast nodes, but it doesn't really mutate them. In addition to that, in clangd we mo

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

2019-09-25 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet updated this revision to Diff 221772. kadircet added a comment. - Use Decl overload of findExplicitReferences Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67748/new/ https://reviews.llvm.org/D67748 Files: clang-tools-extra/clangd/XRefs

[PATCH] D68027: [clangd] Change constness of parameters to findExplicitRefs

2019-09-25 Thread Kadir Cetinkaya via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL372888: [clangd] Change constness of parameters to findExplicitRefs (authored by kadircet, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed prior to commit:

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

2019-09-26 Thread Kadir Cetinkaya via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL372948: [clangd] Add a helper for extracting nonlocal decls in a FunctionDecl (authored by kadircet, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed prior to

[PATCH] D68024: [clangd] Implement GetEligiblePoints

2019-09-26 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet updated this revision to Diff 221896. kadircet added a comment. - Rename regions to points - Return EOF if there are no shared namespaces with the target Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68024/new/ https://reviews.llvm.org/D68

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

2019-09-26 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet updated this revision to Diff 221910. kadircet added a comment. - Rebase and update testhelpers Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D65433/new/ https://reviews.llvm.org/D65433 Files: clang-tools-extra/clangd/refactor/tweaks/Def

[PATCH] D66647: [clangd] DefineInline action apply logic with fully qualified names

2019-09-26 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet updated this revision to Diff 221912. kadircet added a comment. - Rebase and update testhelpers Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D66647/new/ https://reviews.llvm.org/D66647 Files: clang-tools-extra/clangd/refactor/tweaks/Def

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

2019-09-26 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet updated this revision to Diff 221911. kadircet added a comment. - Revert miscommit Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D65433/new/ https://reviews.llvm.org/D65433 Files: clang-tools-extra/clangd/refactor/tweaks/CMakeLists.txt

[PATCH] D66647: [clangd] DefineInline action apply logic with fully qualified names

2019-09-26 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet updated this revision to Diff 221913. kadircet added a comment. - Mark tweak as visible Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D66647/new/ https://reviews.llvm.org/D66647 Files: clang-tools-extra/clangd/refactor/tweaks/DefineInlin

[PATCH] D68024: [clangd] Implement GetEligiblePoints

2019-09-26 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet updated this revision to Diff 221920. kadircet marked an inline comment as done. kadircet added a comment. - Address comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68024/new/ https://reviews.llvm.org/D68024 Files: clang-tools-ex

[PATCH] D68024: [clangd] Implement GetEligiblePoints

2019-09-26 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet marked 5 inline comments as done. kadircet added inline comments. Comment at: clang-tools-extra/clangd/SourceCode.cpp:655 +lex(llvm::StringRef Code, const format::FormatStyle &Style, +llvm::function_ref A) { // FIXME: InMemoryFileAdapter crashes unless the buffer

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

2019-09-26 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet updated this revision to Diff 221947. kadircet added a comment. - Use canonical decl when checking visibility Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D65433/new/ https://reviews.llvm.org/D65433 Files: clang-tools-extra/clangd/refac

[PATCH] D68120: [clangd] Handle type template parameters in findExplicitReferences

2019-09-27 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet accepted this revision. kadircet added a comment. This revision is now accepted and ready to land. LGTM. what about template template and non-type template params ? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68120/new/ https://reviews.l

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

2019-09-27 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet added a comment. mostly LG, a few small comments Comment at: clang-tools-extra/clangd/HeaderSourceSwitch.cpp:86 + auto AwardTarget = [&](const char *TargetURI) { +if (auto TargetPath = URI::resolve(TargetURI, OriginalFile)) { + if (*TargetPath != OriginalFile

[PATCH] D66647: [clangd] DefineInline action apply logic with fully qualified names

2019-09-27 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet added a comment. In D66647#1684012 , @ilya-biryukov wrote: > It's ok to leave this out of the initial change, but could we describe our > strategy to tackle this somewhere in the comments - how we want to fix this > and when. I actually have

[PATCH] D66647: [clangd] DefineInline action apply logic with fully qualified names

2019-09-27 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet updated this revision to Diff 222102. kadircet marked 5 inline comments as done. kadircet added a comment. - Address comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D66647/new/ https://reviews.llvm.org/D66647 Files: clang-tools-ex

[PATCH] D68124: [clangd] Fix template type aliases in findExplicitReference

2019-09-27 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet added inline comments. Comment at: clang-tools-extra/clangd/FindTarget.cpp:478 + explicitReferenceTargets(DynTypedNode::create(L.getType()), + DeclRelation::Alias)}; } can you explain why these two are spec

[PATCH] D66647: [clangd] DefineInline action apply logic with fully qualified names

2019-09-27 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet added a comment. In D66647#1685554 , @ilya-biryukov wrote: > Are we planning to fix this right away or should we keep this indefinitely? > If latter, I believe we should think about some heuristics to avoid > qualification in the short term ins

[PATCH] D68024: [clangd] Implement GetEligiblePoints

2019-09-27 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet marked 3 inline comments as done. kadircet added inline comments. Comment at: clang-tools-extra/clangd/SourceCode.cpp:997 + // definitions as well. One might use a closing parantheses(")" followed by an + // opening brace "{" to trigger the start. + parseNamespaceEve

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

2019-09-27 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet updated this revision to Diff 222158. kadircet added a comment. - Rebase and bail out on methods inside templated classes Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D65433/new/ https://reviews.llvm.org/D65433 Files: clang-tools-extra/

[PATCH] D66647: [clangd] DefineInline action apply logic with fully qualified names

2019-09-27 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet added a comment. In D66647#1684046 , @ilya-biryukov wrote: > We also need to rename parameters sometimes, right? > > // Sometimes we need to rename parameters. > void usages(int decl_param, int); > > void usages(int def_param, int now_nam

[PATCH] D66647: [clangd] DefineInline action apply logic with fully qualified names

2019-09-27 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet updated this revision to Diff 222180. kadircet added a comment. - Add renaming of template and function parameters Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D66647/new/ https://reviews.llvm.org/D66647 Files: clang-tools-extra/clangd/

[PATCH] D68143: [clang] Make handling of unnamed template params similar to function params

2019-09-27 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet created this revision. kadircet added a reviewer: ilya-biryukov. Herald added subscribers: cfe-commits, arphaman. Herald added a project: clang. Clang uses the location identifier should be inserted for declarator decls when a decl is unnamed. But for type template and template template p

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

2019-09-27 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet accepted this revision. kadircet added a comment. This revision is now accepted and ready to land. thanks for formatting test cases, I had it in mind but forgot to mention in last round. LGTM Comment at: clang-tools-extra/clangd/HeaderSourceSwitch.cpp:113 + auto Bes

[PATCH] D68124: [clangd] Fix template type aliases in findExplicitReference

2019-09-27 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet accepted this revision. kadircet added a comment. This revision is now accepted and ready to land. LGTM. Comment at: clang-tools-extra/clangd/FindTarget.cpp:478 + explicitReferenceTargets(DynTypedNode::create(L.getType()), + D

[PATCH] D68024: [clangd] Implement GetEligiblePoints

2019-09-27 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet marked an inline comment as done. kadircet added inline comments. Comment at: clang-tools-extra/clangd/SourceCode.h:270 + /// It will be “a::b” for both carrot locations. + std::string CurrentNamespace; + /// Offsets into the code marking eligible points to insert a f

[PATCH] D68137: [clangd] Handle template arguments in findExplicitReferences

2019-09-30 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet added inline comments. Comment at: clang-tools-extra/clangd/FindTarget.cpp:556 + // We re-define Traverse*, since there's no corresponding Visit*. + bool TraverseTemplateArgumentLoc(TemplateArgumentLoc A) { ... and we need it because, template templa

[PATCH] D68211: [clangd] Use the index-based API to do the header-source switch.

2019-09-30 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet added a comment. thanks, mostly LG Comment at: clang-tools-extra/clangd/ClangdServer.cpp:453 +void ClangdServer::switchSourceHeader( +PathRef Path, Callback> CB) { + if (auto CorrespondingFile = could you add some comments explaining, why we first

[PATCH] D68024: [clangd] Implement GetEligiblePoints

2019-09-30 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet updated this revision to Diff 222434. kadircet marked 7 inline comments as done. kadircet added a comment. - Address comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68024/new/ https://reviews.llvm.org/D68024 Files: clang-tools-ex

[PATCH] D68024: [clangd] Implement GetEligiblePoints

2019-09-30 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet added inline comments. Comment at: clang-tools-extra/clangd/SourceCode.h:270 + /// It will be “a::b” for both carrot locations. + std::string CurrentNamespace; + /// Offsets into the code marking eligible points to insert a function ilya-biryukov wrot

[PATCH] D68211: [clangd] Use the index-based API to do the header-source switch.

2019-09-30 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet accepted this revision. kadircet added a comment. This revision is now accepted and ready to land. some nits, thanks! Comment at: clang-tools-extra/clangd/ClangdServer.cpp:456 + // 1) use the file-only heuristic, it requires some IO but it is much + //faster tha

[PATCH] D68261: [clangd] Add "inline" keyword to prevent ODR-violations in DefineInline

2019-10-01 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet created this revision. kadircet added reviewers: ilya-biryukov, hokein. Herald added subscribers: cfe-commits, usaxena95, arphaman, jkorous, MaskRay. Herald added a project: clang. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D68261 Files: clang-tools-extra/clangd/re

[PATCH] D66647: [clangd] DefineInline action apply logic with fully qualified names

2019-10-01 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet updated this revision to Diff 222562. kadircet added a comment. - Fix getSemiColon to handle semicolons at the end of file Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D66647/new/ https://reviews.llvm.org/D66647 Files: clang-tools-extra

[PATCH] D68143: [clang] Make handling of unnamed template params similar to function params

2019-10-01 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet updated this revision to Diff 222567. kadircet marked 5 inline comments as done. kadircet added a comment. - Address comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68143/new/ https://reviews.llvm.org/D68143 Files: clang/lib/AST/

[PATCH] D68143: [clang] Make handling of unnamed template params similar to function params

2019-10-01 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet added inline comments. Comment at: clang/lib/AST/DeclTemplate.cpp:513 getDefaultArgumentInfo()->getTypeLoc().getEndLoc()); - else -return TypeDecl::getSourceRange(); + else if(getName().empty()) +return SourceRange(getBeginLoc()); --

[PATCH] D68137: [clangd] Handle template arguments in findExplicitReferences

2019-10-01 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet accepted this revision. kadircet added a comment. This revision is now accepted and ready to land. LGTM, thanks! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68137/new/ https://reviews.llvm.org/D68137 __

[PATCH] D68245: [Clangd] ExtractFunction: Don't extract body of enclosing function.

2019-10-01 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet accepted this revision. kadircet added a comment. This revision is now accepted and ready to land. LGTM, thanks Comment at: clang-tools-extra/clangd/refactor/tweaks/ExtractFunction.cpp:231 + if (const Stmt *S = Child->ASTNode.get()) +if (EnclosingFunc->hasBody() &

[PATCH] D68182: [Clangd] Ensure children are always RootStmt in ExtractFunction (Fixes #153)

2019-10-01 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet added inline comments. Comment at: clang-tools-extra/clangd/refactor/tweaks/ExtractFunction.cpp:110 // begins in selection range, ends in selection range and any scope that begins // outside the selection range, ends outside as well. const Node *getParentOfRootStmts(c

[PATCH] D68143: [clang] Make handling of unnamed template params similar to function params

2019-10-01 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet marked an inline comment as done. kadircet added inline comments. Comment at: clang/lib/AST/DeclTemplate.cpp:513 getDefaultArgumentInfo()->getTypeLoc().getEndLoc()); - else -return TypeDecl::getSourceRange(); + else if(getName().empty()) +

[PATCH] D68143: [clang] Make handling of unnamed template params similar to function params

2019-10-01 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet updated this revision to Diff 222581. kadircet added a comment. - Address comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68143/new/ https://reviews.llvm.org/D68143 Files: clang/lib/AST/DeclTemplate.cpp clang/lib/Parse/ParseTem

[PATCH] D68024: [clangd] Implement GetEligiblePoints

2019-10-01 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet updated this revision to Diff 222590. kadircet marked an inline comment as done. kadircet added a comment. - Address comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68024/new/ https://reviews.llvm.org/D68024 Files: clang-tools-ex

[PATCH] D68143: [clang] Make handling of unnamed template params similar to function params

2019-10-01 Thread Kadir Cetinkaya via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL373340: [clang] Make handling of unnamed template params similar to function params (authored by kadircet, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed pr

[PATCH] D68273: [clangd] Fix raciness in code completion tests

2019-10-01 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet created this revision. kadircet added reviewers: sammccall, ilya-biryukov. Herald added subscribers: cfe-commits, usaxena95, arphaman, jkorous, MaskRay. Herald added a project: clang. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D68273 Files: clang-tools-extra/clangd

[PATCH] D68273: [clangd] Fix raciness in code completion tests

2019-10-01 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet updated this revision to Diff 222618. kadircet added a comment. - As discussed offline, making `consumeRequests` take an argument for how many requests to receive before returning. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68273/new/

[PATCH] D68324: [clangd] Always send file URIs to editors

2019-10-02 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet created this revision. Herald added subscribers: cfe-commits, usaxena95, arphaman, jkorous, MaskRay, ilya-biryukov. Herald added a project: clang. kadircet added a reviewer: sammccall. Editors only know about file URIs, make sure we do not use any custom schemes while sending edits. Re

[PATCH] D68324: [clangd] Always send file URIs to editors

2019-10-02 Thread Kadir Cetinkaya via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL373435: [clangd] Always send file URIs to editors (authored by kadircet, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed prior to commit: https://reviews.l

[PATCH] D68273: [clangd] Fix raciness in code completion tests

2019-10-02 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet updated this revision to Diff 222890. kadircet marked 5 inline comments as done. kadircet added a comment. - Address comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68273/new/ https://reviews.llvm.org/D68273 Files: clang-tools-ex

[PATCH] D68273: [clangd] Fix raciness in code completion tests

2019-10-02 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet added inline comments. Comment at: clang-tools-extra/clangd/unittests/CodeCompleteTests.cpp:1141 +ReceivedRequestCV.wait(Lock, + [this, Num] { return NumRequestsReceived == Num; }); +NumRequestsReceived = 0; ilya-biryuko

[PATCH] D66647: [clangd] DefineInline action apply logic with fully qualified names

2019-10-02 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet updated this revision to Diff 222892. kadircet marked 5 inline comments as done. kadircet added a comment. - Update test helper to take an out parameter Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D66647/new/ https://reviews.llvm.org/D666

[PATCH] D68564: [clangd] Catch an unchecked "Expected" in HeaderSourceSwitch.

2019-10-07 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet accepted this revision. kadircet added a comment. This revision is now accepted and ready to land. LGTM Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68564/new/ https://reviews.llvm.org/D68564 ___

[PATCH] D66647: [clangd] DefineInline action apply logic with fully qualified names

2019-10-07 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet updated this revision to Diff 223620. kadircet marked 9 inline comments as done. kadircet added a comment. - Address comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D66647/new/ https://reviews.llvm.org/D66647 Files: clang-tools-ex

[PATCH] D66647: [clangd] DefineInline action apply logic with fully qualified names

2019-10-07 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet added inline comments. Comment at: clang-tools-extra/clangd/refactor/tweaks/DefineInline.cpp:196 + +std::string Qualifier = printNamespaceScope(*ND->getDeclContext()); +if (auto Err = Replacements.add( ilya-biryukov wrote: > You would want to use

[PATCH] D68273: [clangd] Fix raciness in code completion tests

2019-10-07 Thread Kadir Cetinkaya via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL373924: [clangd] Fix raciness in code completion tests (authored by kadircet, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed prior to commit: https://revi

[PATCH] D68702: [clangd] Make sure ReplyCallbacks are destroyed before RequestCancelersMutex

2019-10-09 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet created this revision. kadircet added a reviewer: sammccall. Herald added subscribers: cfe-commits, usaxena95, arphaman, jkorous, MaskRay, ilya-biryukov. Herald added a project: clang. After rL374163 , replycallbacks might have a cancellable context, w

[PATCH] D68702: [clangd] Make sure ReplyCallbacks are destroyed before RequestCancelersMutex

2019-10-09 Thread Kadir Cetinkaya via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG9a3a87d18975: [clangd] Make sure ReplyCallbacks are destroyed before RequestCancelersMutex (authored by kadircet). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.o

[PATCH] D68702: [clangd] Make sure ReplyCallbacks are destroyed before RequestCancelersMutex

2019-10-09 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet updated this revision to Diff 224045. kadircet marked an inline comment as done. kadircet added a comment. - Address comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68702/new/ https://reviews.llvm.org/D68702 Files: clang-tools-ex

[PATCH] D66647: [clangd] DefineInline action apply logic with fully qualified names

2019-10-14 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet updated this revision to Diff 224824. kadircet added a comment. - Move parameter renaming logic to a separate patch. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D66647/new/ https://reviews.llvm.org/D66647 Files: clang-tools-extra/clang

[PATCH] D66647: [clangd] DefineInline action apply logic with fully qualified names

2019-10-14 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet added inline comments. Comment at: clang-tools-extra/clangd/refactor/tweaks/DefineInline.cpp:226 +llvm::Expected +renameParameters(const FunctionDecl *Dest, const FunctionDecl *Source) { + const SourceManager &SM = Dest->getASTContext().getSourceManager(); -

[PATCH] D68937: [clangd] Add parameter renaming to define-inline code action

2019-10-14 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet created this revision. kadircet added a reviewer: ilya-biryukov. Herald added subscribers: cfe-commits, usaxena95, arphaman, jkorous, MaskRay. Herald added a project: clang. When moving a function definition to declaration location we also need to handle renaming of the both function and

[PATCH] D68978: [clangd] Propagate main context into ClangdServer

2019-10-15 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet created this revision. kadircet added a reviewer: sammccall. Herald added subscribers: cfe-commits, usaxena95, arphaman, jkorous, MaskRay, ilya-biryukov. Herald added a project: clang. Currently clangd initializes the ClangdServer lazily during onInitialize request, and it results in pro

[PATCH] D68981: [clangd] Use our own relation kind.

2019-10-15 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet added inline comments. Comment at: clang-tools-extra/clangd/index/MemIndex.h:72 // A map from (subject, predicate) pair to objects. - llvm::DenseMap, std::vector> + llvm::DenseMap, std::vector> Relations; can we rather use `uint8_t` in here i

[PATCH] D68978: [clangd] Propagate main context into ClangdServer

2019-10-15 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet updated this revision to Diff 225027. kadircet marked an inline comment as done. kadircet added a comment. - Move context swapping next to server creation Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68978/new/ https://reviews.llvm.org/D6

[PATCH] D68978: [clangd] Propagate main context into ClangdServer

2019-10-15 Thread Kadir Cetinkaya via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG9d66247e9b78: [clangd] Propagate main context into ClangdServer (authored by kadircet). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68978/new/ https://rev

[PATCH] D68981: [clangd] Use our own relation kind.

2019-10-15 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet added inline comments. Comment at: clang-tools-extra/clangd/index/MemIndex.cpp:95 LookupRequest LookupReq; -auto It = Relations.find(std::make_pair(Subject, Req.Predicate)); +auto It = Relations.find(std::make_pair(Subject, (uint8_t)Req.Predicate)); if

[PATCH] D68981: [clangd] Use our own relation kind.

2019-10-15 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet accepted this revision. kadircet added a comment. This revision is now accepted and ready to land. Thanks, LGTM Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68981/new/ https://reviews.llvm.org/D68981 ___

[PATCH] D69033: [clangd] Improve symbol qualification in DefineInline code action

2019-10-16 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet created this revision. kadircet added a reviewer: ilya-biryukov. Herald added subscribers: cfe-commits, usaxena95, arphaman, jkorous, MaskRay. Herald added a project: clang. Currently define inline action fully qualifies any names in the function body, which is not optimal and definitely

[PATCH] D68937: [clangd] Add parameter renaming to define-inline code action

2019-10-16 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet added a comment. In D68937#1710634 , @ilya-biryukov wrote: > An alternative approach I'm thinking of: > After D68977 lands, we could try using > `findExplicitReferences` to produce all of these edits: > > 1. we

[PATCH] D68937: [clangd] Add parameter renaming to define-inline code action

2019-10-16 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet updated this revision to Diff 225209. kadircet marked an inline comment as done. kadircet added a comment. - Accept StringRef for Source in rewriteParameterName instead of a NamedDecl Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68937/new/

[PATCH] D68977: [clangd] Report declaration references in findExplicitReferences.

2019-10-17 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet added inline comments. Comment at: clang-tools-extra/clangd/AST.cpp:110 + +static bool isAnonymous(const DeclarationName &N) { + return N.isIdentifier() && !N.getAsIdentifierInfo(); could you move this one back above `getQualifierLoc` ? ==

[PATCH] D69033: [clangd] Improve symbol qualification in DefineInline code action

2019-10-17 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet updated this revision to Diff 225416. kadircet marked an inline comment as done. kadircet added a comment. - Handle using directives Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D69033/new/ https://reviews.llvm.org/D69033 Files: clang-t

[PATCH] D69033: [clangd] Improve symbol qualification in DefineInline code action

2019-10-17 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet marked 5 inline comments as done. kadircet added a comment. In D69033#1710955 , @ilya-biryukov wrote: > We seem to have trouble only in presence of using declarations and using > namespace directives. > I wonder how complicated it would be to t

[PATCH] D68977: [clangd] Report declaration references in findExplicitReferences.

2019-10-17 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet added inline comments. Comment at: clang-tools-extra/clangd/FindTarget.cpp:415 Optional refInDecl(const Decl *D) { struct Visitor : ConstDeclVisitor { ilya-biryukov wrote: > kadircet wrote: > > ilya-biryukov wrote: > > > hokein wrote: > > > > ilya-

[PATCH] D68590: [clangd] Improve hover support for Objective-C

2019-10-18 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet added inline comments. Comment at: clangd/XRefs.cpp:461 + + OS << (Method->isInstanceMethod() ? '-' : '+') + << '[' << Class->getName(); it looks like `DeclPrinter::VisitObjCMethodDecl` already has a similar handling. would it provide value if you p

[PATCH] D69165: [clangd] Store Index in Tweak::Selection

2019-10-18 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet created this revision. kadircet added a reviewer: ilya-biryukov. Herald added subscribers: cfe-commits, usaxena95, arphaman, jkorous, MaskRay. Herald added a project: clang. Incoming define out-of-line tweak requires access to index. This patch simply propogates the index in ClangdServer

[PATCH] D69177: [clangd] Propogate FS into Tweak::Selection

2019-10-18 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet created this revision. kadircet added a reviewer: ilya-biryukov. Herald added subscribers: cfe-commits, usaxena95, arphaman, jkorous, MaskRay. Herald added a project: clang. kadircet added a parent revision: D69165: [clangd] Store Index in Tweak::Selection. Incoming define out-of-line co

[PATCH] D69165: [clangd] Store Index in Tweak::Selection

2019-10-21 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet updated this revision to Diff 225837. kadircet added a comment. - Address comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D69165/new/ https://reviews.llvm.org/D69165 Files: clang-tools-extra/clangd/ClangdServer.cpp clang-tools-e

[PATCH] D69165: [clangd] Store Index in Tweak::Selection

2019-10-21 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet marked 3 inline comments as done. kadircet added inline comments. Comment at: clang-tools-extra/clangd/unittests/TweakTesting.h:71 + // Index to be passed into Tweak::Selection. + const SymbolIndex *Index = nullptr; + ilya-biryukov wrote: > How is this

[PATCH] D69165: [clangd] Store Index in Tweak::Selection

2019-10-21 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet marked an inline comment as done. kadircet added inline comments. Comment at: clang-tools-extra/clangd/unittests/TweakTesting.h:71 + // Index to be passed into Tweak::Selection. + const SymbolIndex *Index = nullptr; + ilya-biryukov wrote: > kadircet wr

[PATCH] D69165: [clangd] Store Index in Tweak::Selection

2019-10-21 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet updated this revision to Diff 225850. kadircet added a comment. - Store unique_ptr instead of a raw one. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D69165/new/ https://reviews.llvm.org/D69165 Files: clang-tools-extra/clangd/ClangdServ

[PATCH] D69165: [clangd] Store Index in Tweak::Selection

2019-10-21 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet updated this revision to Diff 225871. kadircet marked 4 inline comments as done. kadircet added a comment. - Address comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D69165/new/ https://reviews.llvm.org/D69165 Files: clang-tools-ex

[PATCH] D69177: [clangd] Propogate FS into Tweak::Selection

2019-10-21 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet abandoned this revision. kadircet added a comment. As discussed offline, dropping the change to fetch the FS from filemanager, to prevent any consistency that might be caused due to having different contents for files in AST while creating it vs while generating refactorings. Reposito

[PATCH] D69266: [clangd] Define out-of-line availability checks

2019-10-21 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet created this revision. kadircet added a reviewer: hokein. Herald added subscribers: cfe-commits, usaxena95, arphaman, jkorous, MaskRay, ilya-biryukov, mgorny. Herald added a project: clang. Initial availability checks for performing define out-of-line code action, which is a refactoring

[PATCH] D69298: [clangd] Define out-of-line initial apply logic

2019-10-22 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet created this revision. kadircet added a reviewer: hokein. Herald added subscribers: cfe-commits, usaxena95, arphaman, jkorous, MaskRay, ilya-biryukov. Herald added a project: clang. Initial implementation for apply logic, replaces function body with a semicolon in source location and cop

[PATCH] D69266: [clangd] Define out-of-line availability checks

2019-10-22 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet updated this revision to Diff 226045. kadircet marked 8 inline comments as done. kadircet added a comment. - Address comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D69266/new/ https://reviews.llvm.org/D69266 Files: clang-tools-ex

[PATCH] D69266: [clangd] Define out-of-line availability checks

2019-10-22 Thread Kadir Cetinkaya via Phabricator via cfe-commits
kadircet added inline comments. Comment at: clang-tools-extra/clangd/refactor/tweaks/DefineOutline.cpp:29 +// criteria is met. +const FunctionDecl *getSelectedFunction(const SelectionTree::Node *SelNode) { + if (!SelNode) hokein wrote: > nit: looks like we also

<    5   6   7   8   9   10   11   12   13   14   >