[clang-tools-extra] [clangd] Find better insertion locations in DefineOutline tweak (PR #128164)

2025-02-27 Thread Christian Kandeler via cfe-commits
https://github.com/ckandeler updated https://github.com/llvm/llvm-project/pull/128164 >From cca5b5a1d7f50ea7923fdc1ba63764c0b787ef8d Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Mon, 25 Nov 2024 17:39:21 +0100 Subject: [PATCH] [clangd] Find better insertion locations in DefineOutline

[clang-tools-extra] [clangd] Find better insertion locations in DefineOutline tweak (PR #128164)

2025-02-25 Thread Christian Kandeler via cfe-commits
https://github.com/ckandeler updated https://github.com/llvm/llvm-project/pull/128164 >From da6a6e8fccf99f595d38e7ff6785b605a38401db Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Mon, 25 Nov 2024 17:39:21 +0100 Subject: [PATCH] [clangd] Find better insertion locations in DefineOutline

[clang-tools-extra] [clangd] Find better insertion locations in DefineOutline tweak (PR #128164)

2025-02-25 Thread Christian Kandeler via cfe-commits
https://github.com/ckandeler updated https://github.com/llvm/llvm-project/pull/128164 >From de493ea09fc685ef700bd618eeb847c631a18995 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Mon, 25 Nov 2024 17:39:21 +0100 Subject: [PATCH] [clangd] Find better insertion locations in DefineOutline

[clang-tools-extra] [clangd] Find better insertion locations in DefineOutline tweak (PR #128164)

2025-02-25 Thread Christian Kandeler via cfe-commits
https://github.com/ckandeler updated https://github.com/llvm/llvm-project/pull/128164 >From dcecc6815af5e71b6a9fed380c859c957961240a Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Mon, 25 Nov 2024 17:39:21 +0100 Subject: [PATCH] [clangd] Find better insertion locations in DefineOutline

[clang-tools-extra] [clangd] Find better insertion locations in DefineOutline tweak (PR #128164)

2025-02-25 Thread Christian Kandeler via cfe-commits
https://github.com/ckandeler updated https://github.com/llvm/llvm-project/pull/128164 >From 615acbb28d8f03f4553d18680ade62144ed44a09 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Mon, 25 Nov 2024 17:39:21 +0100 Subject: [PATCH] [clangd] Find better insertion locations in DefineOutline

[clang-tools-extra] [clangd] Find better insertion locations in DefineOutline tweak (PR #128164)

2025-02-21 Thread Christian Kandeler via cfe-commits
https://github.com/ckandeler created https://github.com/llvm/llvm-project/pull/128164 If possible, put the definition next to the definition of an adjacent declaration. For example: struct S { void f^oo1() {} void foo2(); void f^oo3() {} }; // S::foo1() goes here void S::foo2() {} // S:

[clang-tools-extra] [clangd] Store full decl/def range with symbol locations (PR #118102)

2025-02-18 Thread Christian Kandeler via cfe-commits
ckandeler wrote: > 2. A more general musing: it would be nice to have a mechanism for storing > additional information for a subset of symbols, without incurring the > overhead of increasing the representation size of **every** symbol. If we had > such a mechanism, we could cut down the overhe

[clang-tools-extra] [clangd] Store full decl/def range with symbol locations (PR #118102)

2025-02-17 Thread Christian Kandeler via cfe-commits
ckandeler wrote: *sigh* I want to use clangd for this purpose because it produces correct results particularly with non-trivial constructs, so I'm afraid that using such textual heuristics would kill that advantage. I'll give it a try, though. https://github.com/llvm/llvm-project/pull/118102

[clang-tools-extra] [clangd] Store full decl/def range with symbol locations (PR #118102)

2025-02-17 Thread Christian Kandeler via cfe-commits
ckandeler wrote: My main motivation is to get DefineOutline out of the proof-of-concept stage where it just dumps the definition somewhere in the same namespace. Usually, the location that best fits the user's expectation is next to the definition of an adjacent declaration. If that adjacent d

[clang-tools-extra] [clangd] Store full decl/def range with symbol locations (PR #118102)

2025-02-10 Thread Christian Kandeler via cfe-commits
ckandeler wrote: ping https://github.com/llvm/llvm-project/pull/118102 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Consider expression statements in ExtractVariable tweak (PR #112525)

2024-12-11 Thread Christian Kandeler via cfe-commits
https://github.com/ckandeler closed https://github.com/llvm/llvm-project/pull/112525 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Consider expression statements in ExtractVariable tweak (PR #112525)

2024-12-10 Thread Christian Kandeler via cfe-commits
ckandeler wrote: Addressed review comments. https://github.com/llvm/llvm-project/pull/112525 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Consider expression statements in ExtractVariable tweak (PR #112525)

2024-12-10 Thread Christian Kandeler via cfe-commits
@@ -423,8 +427,6 @@ bool childExprIsStmt(const Stmt *Outer, const Expr *Inner) { if (!Outer || !Inner) return false; // Exclude the most common places where an expr can appear but be unused. - if (llvm::isa(Outer)) ckandeler wrote: I made the comment

[clang-tools-extra] [clangd] Consider expression statements in ExtractVariable tweak (PR #112525)

2024-12-10 Thread Christian Kandeler via cfe-commits
https://github.com/ckandeler updated https://github.com/llvm/llvm-project/pull/112525 >From 9993b1488c26b8296d3bb46b83e9c2f133d76c2d Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Tue, 23 May 2023 13:16:38 +0200 Subject: [PATCH] [clangd] Consider expression statements in ExtractVariabl

[clang-tools-extra] [clangd] Consider expression statements in ExtractVariable tweak (PR #112525)

2024-12-10 Thread Christian Kandeler via cfe-commits
ckandeler wrote: Rebased. https://github.com/llvm/llvm-project/pull/112525 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Consider expression statements in ExtractVariable tweak (PR #112525)

2024-12-10 Thread Christian Kandeler via cfe-commits
https://github.com/ckandeler updated https://github.com/llvm/llvm-project/pull/112525 >From 83104569563db9a6716aae941edf9fe15493081a Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Tue, 23 May 2023 13:16:38 +0200 Subject: [PATCH] [clangd] Consider expression statements in ExtractVariabl

[clang-tools-extra] [clangd] Consider expression statements in ExtractVariable tweak (PR #112525)

2024-12-09 Thread Christian Kandeler via cfe-commits
ckandeler wrote: > In the expression-statement case, the expression isn't moving to a new > location, and the variable name is only mentioned in > one place. In essence, the refactoring amounts to prepending `auto > placeholder = ` to the expression. Given that you're > going to be (very like

[clang-tools-extra] [clangd] Store full decl/def range with symbol locations (PR #118102)

2024-12-05 Thread Christian Kandeler via cfe-commits
https://github.com/ckandeler updated https://github.com/llvm/llvm-project/pull/118102 >From c44237813fb3357dee3f7d17048a7178e67a2422 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Wed, 27 Nov 2024 13:47:32 +0100 Subject: [PATCH] [clangd] Store full decl/def range with symbol locations

[clang-tools-extra] [clangd] Store full decl/def range with symbol locations (PR #118102)

2024-12-05 Thread Christian Kandeler via cfe-commits
https://github.com/ckandeler updated https://github.com/llvm/llvm-project/pull/118102 >From 188cbf1a7d3e83c0a558550351a373c1c3475d4e Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Wed, 27 Nov 2024 13:47:32 +0100 Subject: [PATCH] [clangd] Store full decl/def range with symbol locations

[clang-tools-extra] [clangd] Consolidate two functions converting index to LSP locations (PR #117885)

2024-12-05 Thread Christian Kandeler via cfe-commits
https://github.com/ckandeler closed https://github.com/llvm/llvm-project/pull/117885 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Store full decl/def range with symbol locations (PR #118102)

2024-11-29 Thread Christian Kandeler via cfe-commits
https://github.com/ckandeler created https://github.com/llvm/llvm-project/pull/118102 Apart from fixing the linked issue, this is also necessary for supporting LSP's LocationLink feature and for finding proper insertion locations in the DefineOutline tweak. Memory consumption of the background

[clang-tools-extra] [clangd] Consolidate two functions converting index to LSP locations (PR #117885)

2024-11-27 Thread Christian Kandeler via cfe-commits
https://github.com/ckandeler created https://github.com/llvm/llvm-project/pull/117885 None >From 7aa28a386a84c4fa8e7e8aa13822fd3e058b076c Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Wed, 27 Nov 2024 14:55:18 +0100 Subject: [PATCH] [clangd] Consolidate two functions converting index

[clang-tools-extra] [clangd] Drop requirement for named template parameters (PR #117565)

2024-11-26 Thread Christian Kandeler via cfe-commits
https://github.com/ckandeler closed https://github.com/llvm/llvm-project/pull/117565 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Drop requirement for named template parameters (PR #117565)

2024-11-25 Thread Christian Kandeler via cfe-commits
https://github.com/ckandeler created https://github.com/llvm/llvm-project/pull/117565 ... in DefineOutline tweak for function templates. As opposed to class templates, the name is not required for writing an out-of-line definition. >From 064d23753ed1ac673bda33ab815dbb12c6bcc6f6 Mon Sep 17 00:0

[clang-tools-extra] [clangd] Support outgoing calls in call hierarchy (PR #77556)

2024-11-25 Thread Christian Kandeler via cfe-commits
https://github.com/ckandeler approved this pull request. Appears to work fine. Regarding the slight memory increase: If anyone feels strongly about it, they had plenty of time to chime in. https://github.com/llvm/llvm-project/pull/77556 ___ cfe-commit

[clang-tools-extra] [clangd] Support outgoing calls in call hierarchy (PR #77556)

2024-11-20 Thread Christian Kandeler via cfe-commits
@@ -88,56 +89,6 @@ # CHECK-NEXT: } # CHECK-NEXT: ] --- -{"jsonrpc":"2.0","id":2,"method":"typeHierarchy/subtypes","params":{"item":{"uri":"test:///main.cpp","data":{"parents":[{"parents":[{"parents":[],"symbolID":"FE546E7B648D69A7"}],"symbolID":"ECDC0C46D75120F4"}],"symbol

[clang-tools-extra] [clangd] Support outgoing calls in call hierarchy (PR #77556)

2024-11-20 Thread Christian Kandeler via cfe-commits
@@ -2346,11 +2346,11 @@ outgoingCalls(const CallHierarchyItem &Item, const SymbolIndex *Index) { // Filter references to only keep function calls using SK = index::SymbolKind; auto Kind = Callee.SymInfo.Kind; -if (Kind != SK::Function && Kind != SK::InstanceMet

[clang-tools-extra] [clangd] Support outgoing calls in call hierarchy (PR #77556)

2024-11-20 Thread Christian Kandeler via cfe-commits
@@ -2346,11 +2346,11 @@ outgoingCalls(const CallHierarchyItem &Item, const SymbolIndex *Index) { // Filter references to only keep function calls ckandeler wrote: This comment doesn't really apply anymore. https://github.com/llvm/llvm-project/pull/77556 __

[clang-tools-extra] [clangd] Fix erroneous qualification of template type parameters (PR #116821)

2024-11-20 Thread Christian Kandeler via cfe-commits
https://github.com/ckandeler closed https://github.com/llvm/llvm-project/pull/116821 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Fix erroneous qualification of template type parameters (PR #116821)

2024-11-19 Thread Christian Kandeler via cfe-commits
https://github.com/ckandeler created https://github.com/llvm/llvm-project/pull/116821 ...in DefineOutline tweak. E.g. moving the following definition: template struct S { T f^oo() const { return T(); } }; would result in: // ... template S::T S::foo() const { return T(); } instead of: te

[clang-tools-extra] [clangd] Fix erroneous qualification of template type parameters (PR #116821)

2024-11-19 Thread Christian Kandeler via cfe-commits
https://github.com/ckandeler edited https://github.com/llvm/llvm-project/pull/116821 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Let DefineOutline tweak handle member function templates (PR #112345)

2024-11-19 Thread Christian Kandeler via cfe-commits
https://github.com/ckandeler closed https://github.com/llvm/llvm-project/pull/112345 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Let DefineOutline tweak handle member function templates (PR #112345)

2024-11-18 Thread Christian Kandeler via cfe-commits
@@ -443,13 +461,26 @@ class DefineOutline : public Tweak { SameFile = true; // Bail out if the template parameter is unnamed. +// FIXME: Is this really needed? It inhibits application on ckandeler wrote: I've moved the comment down to

[clang-tools-extra] [clangd] Let DefineOutline tweak handle member function templates (PR #112345)

2024-11-18 Thread Christian Kandeler via cfe-commits
https://github.com/ckandeler updated https://github.com/llvm/llvm-project/pull/112345 >From 5b563ceec2c3462a00101526fa416a835a59e7c0 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Mon, 14 Oct 2024 15:37:01 +0200 Subject: [PATCH] [clangd] Let DefineOutline tweak handle member function

[clang-tools-extra] [clangd] Let DefineOutline tweak handle member function templates (PR #112345)

2024-10-18 Thread Christian Kandeler via cfe-commits
ckandeler wrote: > ```c++ > template > inline void Foo::bar(const T& t, const U& u) {} > ``` > > this won't compile as `T` isn't defined. you also need to print `template > ` on top (and keep doing for rest of the outer decls). The patch does that already. In the test, the outer template dec

[clang-tools-extra] [clangd] fix extract-to-function for overloaded operators (PR #81640)

2024-10-17 Thread Christian Kandeler via cfe-commits
ckandeler wrote: Needs rebase and another typo fix. Looks good to me otherwise. https://github.com/llvm/llvm-project/pull/81640 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] fix extract-to-function for overloaded operators (PR #81640)

2024-10-17 Thread Christian Kandeler via cfe-commits
@@ -105,7 +105,7 @@ bool isRootStmt(const Node *N) { if (N->Selected == SelectionTree::Partial) return false; // A DeclStmt can be an unselected RootStmt since VarDecls claim the entire - // selection range in selectionTree. Additionally, an CXXOperatorCallExpr of a +

[clang-tools-extra] [clangd] Let DefineOutline tweak handle member function templates (PR #112345)

2024-10-15 Thread Christian Kandeler via cfe-commits
https://github.com/ckandeler updated https://github.com/llvm/llvm-project/pull/112345 >From 42ea89f38b599796b15d50d078cba1cb0e0f2b02 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Mon, 14 Oct 2024 15:37:01 +0200 Subject: [PATCH] [clangd] Let DefineOutline tweak handle member function

[clang-tools-extra] [clangd] Let DefineOutline tweak handle member function templates (PR #112345)

2024-10-15 Thread Christian Kandeler via cfe-commits
https://github.com/ckandeler updated https://github.com/llvm/llvm-project/pull/112345 >From 5b729d0bc7b2d5ed2f0d1645a29e3fb9b0a35033 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Mon, 14 Oct 2024 15:37:01 +0200 Subject: [PATCH] [clangd] Let DefineOutline tweak handle member function

[clang-tools-extra] [clangd] Let DefineOutline tweak handle member function templates (PR #112345)

2024-10-15 Thread Christian Kandeler via cfe-commits
https://github.com/ckandeler updated https://github.com/llvm/llvm-project/pull/112345 >From 0d847ccd3b26f2e0ef1203c091d6152d6abea58a Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Mon, 14 Oct 2024 15:37:01 +0200 Subject: [PATCH] [clangd] Let DefineOutline tweak handle member function

[clang-tools-extra] [clangd] Let DefineOutline tweak handle member function templates (PR #112345)

2024-10-15 Thread Christian Kandeler via cfe-commits
https://github.com/ckandeler created https://github.com/llvm/llvm-project/pull/112345 None >From f2b6d67d882fca9a1dae3b50166541df7f22cb44 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Mon, 14 Oct 2024 15:37:01 +0200 Subject: [PATCH] [clangd] Let DefineOutline tweak handle member func

[clang-tools-extra] [clangd] Let DefineOutline tweak handle member functions (PR #95235)

2024-10-14 Thread Christian Kandeler via cfe-commits
ckandeler wrote: Thanks! https://github.com/llvm/llvm-project/pull/95235 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Let DefineOutline tweak handle member functions (PR #95235)

2024-10-14 Thread Christian Kandeler via cfe-commits
https://github.com/ckandeler closed https://github.com/llvm/llvm-project/pull/95235 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Let DefineOutline tweak handle member functions (PR #95235)

2024-10-09 Thread Christian Kandeler via cfe-commits
ckandeler wrote: ping https://github.com/llvm/llvm-project/pull/95235 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Collect comments from function definitions into the index (PR #67802)

2024-09-20 Thread Christian Kandeler via cfe-commits
@@ -451,8 +451,17 @@ const RawComment *ASTContext::getRawCommentForAnyRedecl( if (LastCheckedRedecl) { if (LastCheckedRedecl == Redecl) { LastCheckedRedecl = nullptr; +continue; ckandeler wrote: Done. https://github.com/llvm/llvm-pro

[clang-tools-extra] [clangd] Collect comments from function definitions into the index (PR #67802)

2024-09-20 Thread Christian Kandeler via cfe-commits
https://github.com/ckandeler updated https://github.com/llvm/llvm-project/pull/67802 >From 9dd725113a156a01f1866cfefe181c1b22f7e8d0 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Fri, 29 Sep 2023 15:01:58 +0200 Subject: [PATCH] [clangd] Collect comments from function definitions into t

[clang] [clang-tools-extra] [clangd] Collect comments from function definitions into the index (PR #67802)

2024-09-13 Thread Christian Kandeler via cfe-commits
ckandeler wrote: > Meanwhile, I thought of a fix for #108145 and submitted it as #108475. > If that's accepted, you should be able to drop the `ASTContext.cpp` changes > from this patch. Nice, will do. https://github.com/llvm/llvm-project/pull/67802 __

[clang] [clang-tools-extra] [clangd] Collect comments from function definitions into the index (PR #67802)

2024-09-13 Thread Christian Kandeler via cfe-commits
https://github.com/ckandeler updated https://github.com/llvm/llvm-project/pull/67802 >From f441c0bd52add3d5b63bc0f19a3d38cb12477359 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Fri, 29 Sep 2023 15:01:58 +0200 Subject: [PATCH] [clangd] Collect comments from function definitions into t

[clang] [clang-tools-extra] [clangd] Collect comments from function definitions into the index (PR #67802)

2024-09-12 Thread Christian Kandeler via cfe-commits
https://github.com/ckandeler updated https://github.com/llvm/llvm-project/pull/67802 >From dec33143e617967dee46ce4123a2e298220d73fc Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Fri, 29 Sep 2023 15:01:58 +0200 Subject: [PATCH] [clangd] Collect comments from function definitions into t

[clang] [clang-tools-extra] [clangd] Collect comments from function definitions into the index (PR #67802)

2024-09-11 Thread Christian Kandeler via cfe-commits
@@ -1477,6 +1477,26 @@ TEST_F(SymbolCollectorTest, Documentation) { forCodeCompletion(false; } +TEST_F(SymbolCollectorTest, DocumentationInMain) { ckandeler wrote: Hm, do we really want to specify a behavior there? My thinking was

[clang] [clang-tools-extra] [clangd] Collect comments from function definitions into the index (PR #67802)

2024-09-11 Thread Christian Kandeler via cfe-commits
ckandeler wrote: > I wrote a libAST unit test to demonstrate the bug, and filed #108145 about > it. Hopefully folks more familiar with that code can suggest an appropriate > fix there. Awesome, thanks. https://github.com/llvm/llvm-project/pull/67802 ___

[clang] [clang-tools-extra] [clangd] Collect comments from function definitions into the index (PR #67802)

2024-09-09 Thread Christian Kandeler via cfe-commits
@@ -1069,6 +1071,27 @@ void SymbolCollector::addDefinition(const NamedDecl &ND, Symbol S = DeclSym; // FIXME: use the result to filter out symbols. S.Definition = *DefLoc; + + std::string DocComment; + std::string Documentation; + if (!(S.Flags & Symbol::HasDocComment)

[clang] [clang-tools-extra] [clangd] Collect comments from function definitions into the index (PR #67802)

2024-09-09 Thread Christian Kandeler via cfe-commits
ckandeler wrote: > At this point, my main feedback is that it would be good to include some unit > tests. `SymbolCollectorTests.cpp` is a good > place for them. I've added a new test and verified that it fails without this patch. > What is the purpose of the change to `ASTContext.cpp`? Ther

[clang] [clang-tools-extra] [clangd] Collect comments from function definitions into the index (PR #67802)

2024-09-09 Thread Christian Kandeler via cfe-commits
https://github.com/ckandeler updated https://github.com/llvm/llvm-project/pull/67802 >From 80e15f748b30d4e977b58a42d8fd4403234bb954 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Fri, 29 Sep 2023 15:01:58 +0200 Subject: [PATCH] [clangd] Collect comments from function definitions into t

[clang-tools-extra] [clangd] Let DefineOutline tweak handle member functions (PR #95235)

2024-08-26 Thread Christian Kandeler via cfe-commits
https://github.com/ckandeler updated https://github.com/llvm/llvm-project/pull/95235 >From de740c00c4cc3a9f2e8aff14cf8ebd880a240e58 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Tue, 14 Nov 2023 16:35:46 +0100 Subject: [PATCH] [clangd] Let DefineOutline tweak handle member functions

[clang-tools-extra] [clangd] Let DefineOutline tweak handle member functions (PR #95235)

2024-08-26 Thread Christian Kandeler via cfe-commits
@@ -407,10 +431,21 @@ class DefineOutline : public Tweak { return !SameFile; } -// Bail out in templated classes, as it is hard to spell the class name, -// i.e if the template parameter is unnamed. -if (MD->getParent()->isTemplated()) - return false

[clang-tools-extra] [clangd] Let DefineOutline tweak handle member functions (PR #95235)

2024-08-26 Thread Christian Kandeler via cfe-commits
@@ -144,8 +144,13 @@ getQualification(ASTContext &Context, const DeclContext *DestContext, // since we stored inner-most parent first. std::string Result; llvm::raw_string_ostream OS(Result); - for (const auto *Parent : llvm::reverse(Parents)) + for (const auto *Parent

[clang-tools-extra] [clangd] Let DefineOutline tweak handle member functions (PR #95235)

2024-06-12 Thread Christian Kandeler via cfe-commits
https://github.com/ckandeler created https://github.com/llvm/llvm-project/pull/95235 ... of class templates. >From fc3a907ab2550a999801d37400268fdc31df054d Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Tue, 14 Nov 2023 16:35:46 +0100 Subject: [PATCH] [clangd] Let DefineOutline tweak

[clang-tools-extra] [clangd] Allow "move function body out-of-line" in non-header files (PR #69704)

2024-06-03 Thread Christian Kandeler via cfe-commits
https://github.com/ckandeler closed https://github.com/llvm/llvm-project/pull/69704 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Allow "move function body out-of-line" in non-header files (PR #69704)

2024-06-03 Thread Christian Kandeler via cfe-commits
ckandeler wrote: I'm going to merge this without explicit format approval based on the following: - There was a general LGTM. - I addressed the remaining issues. - There was no further feedback for more than half a year. https://github.com/llvm/llvm-project/pull/69704 _

[clang-tools-extra] [clangd] Support callHierarchy/outgoingCalls (PR #91191)

2024-05-06 Thread Christian Kandeler via cfe-commits
ckandeler wrote: > If I'm understanding correctly, the implementation approach in this PR only > finds callees in the current translation > unit. > The approach in #77556 uses the project's index to find callees across > translation unit boundaries. Right, that's obviously nicer. > Regarding

[clang-tools-extra] [clangd] Support callHierarchy/outgoingCalls (PR #91191)

2024-05-06 Thread Christian Kandeler via cfe-commits
ckandeler wrote: > I remembered @HighCommander4 had filed a similar PR at #77556. Is this one > separate, or are they actually the same (i.e. both are salvaged from > https://reviews.llvm.org/D93829)? I didn't know about that one. Seems nothing gets reviewed anymore these days. https://github

[clang-tools-extra] [clangd] Support callHierarchy/outgoingCalls (PR #91191)

2024-05-06 Thread Christian Kandeler via cfe-commits
https://github.com/ckandeler closed https://github.com/llvm/llvm-project/pull/91191 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Support callHierarchy/outgoingCalls (PR #91191)

2024-05-06 Thread Christian Kandeler via cfe-commits
https://github.com/ckandeler created https://github.com/llvm/llvm-project/pull/91191 None >From d7cfeb6599fd507eed8935e452efd782fc3f0481 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Tue, 30 Apr 2024 18:20:05 +0200 Subject: [PATCH] [clangd] Support callHierarchy/outgoingCalls --- c

[clang] [clang-tools-extra] [clangd] Collect comments from function definitions into the index (PR #67802)

2024-05-02 Thread Christian Kandeler via cfe-commits
ckandeler wrote: ping https://github.com/llvm/llvm-project/pull/67802 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Allow "move function body out-of-line" in non-header files (PR #69704)

2024-05-02 Thread Christian Kandeler via cfe-commits
ckandeler wrote: ping https://github.com/llvm/llvm-project/pull/69704 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Remove potential prefix from enum value names (PR #83412)

2024-05-02 Thread Christian Kandeler via cfe-commits
https://github.com/ckandeler closed https://github.com/llvm/llvm-project/pull/83412 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Remove potential prefix from enum value names (PR #83412)

2024-05-02 Thread Christian Kandeler via cfe-commits
https://github.com/ckandeler reopened https://github.com/llvm/llvm-project/pull/83412 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Remove potential prefix from enum value names (PR #83412)

2024-05-02 Thread Christian Kandeler via cfe-commits
https://github.com/ckandeler closed https://github.com/llvm/llvm-project/pull/83412 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Remove potential prefix from enum value names (PR #83412)

2024-05-02 Thread Christian Kandeler via cfe-commits
ckandeler wrote: Underscore separators get removed now. https://github.com/llvm/llvm-project/pull/83412 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Remove potential prefix from enum value names (PR #83412)

2024-05-02 Thread Christian Kandeler via cfe-commits
https://github.com/ckandeler updated https://github.com/llvm/llvm-project/pull/83412 >From 349edc160e9c13068c42b35321814296bb713a09 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Thu, 29 Feb 2024 12:26:52 +0100 Subject: [PATCH] [clangd] Remove potential prefix from enum value names ..

[clang-tools-extra] [clangd] Let DefineOutline tweak create a definition from scratch (PR #71950)

2024-04-18 Thread Christian Kandeler via cfe-commits
ckandeler wrote: We should probably rekindle the discussion on the associated bug report; I think users (rightly) expect this feature. https://github.com/llvm/llvm-project/pull/71950 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://list

[clang-tools-extra] [clangd] use existing function for code locations in the scopify enum tweak (PR #88737)

2024-04-15 Thread Christian Kandeler via cfe-commits
https://github.com/ckandeler approved this pull request. https://github.com/llvm/llvm-project/pull/88737 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Remove potential prefix from enum value names (PR #83412)

2024-04-15 Thread Christian Kandeler via cfe-commits
ckandeler wrote: Incorporated review comments. https://github.com/llvm/llvm-project/pull/83412 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Remove potential prefix from enum value names (PR #83412)

2024-04-15 Thread Christian Kandeler via cfe-commits
https://github.com/ckandeler updated https://github.com/llvm/llvm-project/pull/83412 >From 78393d26e62f2f9a30f366501f8e61b1a32d6af4 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Thu, 29 Feb 2024 12:26:52 +0100 Subject: [PATCH] [clangd] Remove potential prefix from enum value names ..

[clang-tools-extra] [clangd] Allow "move function body out-of-line" in non-header files (PR #69704)

2024-04-08 Thread Christian Kandeler via cfe-commits
ckandeler wrote: ping https://github.com/llvm/llvm-project/pull/69704 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-tools-extra] [clangd] Collect comments from function definitions into the index (PR #67802)

2024-04-08 Thread Christian Kandeler via cfe-commits
ckandeler wrote: ping https://github.com/llvm/llvm-project/pull/67802 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Fix JSON conversion for symbol tags (PR #84747)

2024-03-11 Thread Christian Kandeler via cfe-commits
https://github.com/ckandeler created https://github.com/llvm/llvm-project/pull/84747 The wrong constructor of json::Value got called, making every tag an array instead of a number. >From f67994902314acd8ae0f0c561b07b8c014172e17 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Mon, 11 M

[clang-tools-extra] [clangd] Allow "move function body out-of-line" in non-header files (PR #69704)

2024-03-04 Thread Christian Kandeler via cfe-commits
ckandeler wrote: ping https://github.com/llvm/llvm-project/pull/69704 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Remove potential prefix from enum value names (PR #83412)

2024-03-01 Thread Christian Kandeler via cfe-commits
https://github.com/ckandeler updated https://github.com/llvm/llvm-project/pull/83412 >From 01f74ddece947755938ccecbcc5f9d18a41eb793 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Thu, 29 Feb 2024 12:26:52 +0100 Subject: [PATCH] [clangd] Remove potential prefix from enum value names ..

[clang-tools-extra] [clangd] Remove potential prefix from enum value names (PR #83412)

2024-02-29 Thread Christian Kandeler via cfe-commits
https://github.com/ckandeler created https://github.com/llvm/llvm-project/pull/83412 ... when converting unscoped to scoped enums. With traditional enums, a popular technique to guard against potential name clashes is to use the enum name as a pseudo-namespace, like this: enum MyEnum { MyEnum

[clang-tools-extra] [clangd] Do not offer extraction to variable for decl init expression (PR #69477)

2024-02-19 Thread Christian Kandeler via cfe-commits
https://github.com/ckandeler closed https://github.com/llvm/llvm-project/pull/69477 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Do not offer extraction to variable for decl init expression (PR #69477)

2024-02-19 Thread Christian Kandeler via cfe-commits
@@ -490,6 +491,13 @@ bool eligibleForExtraction(const SelectionTree::Node *N) { BO->getRHS() == OuterImplicit.ASTNode.get()) return false; } + if (const auto *Decl = Parent->ASTNode.get()) { +if (!Decl->isInitCapture() && ckandeler wrote:

[clang-tools-extra] [clangd] Do not offer extraction to variable for decl init expression (PR #69477)

2024-02-19 Thread Christian Kandeler via cfe-commits
@@ -490,6 +491,13 @@ bool eligibleForExtraction(const SelectionTree::Node *N) { BO->getRHS() == OuterImplicit.ASTNode.get()) return false; } + if (const auto *Decl = Parent->ASTNode.get()) { +if (!Decl->isInitCapture() && ckandeler wrote:

[clang-tools-extra] [clangd] Do not offer extraction to variable for decl init expression (PR #69477)

2024-02-19 Thread Christian Kandeler via cfe-commits
@@ -490,6 +491,13 @@ bool eligibleForExtraction(const SelectionTree::Node *N) { BO->getRHS() == OuterImplicit.ASTNode.get()) return false; } + if (const auto *Decl = Parent->ASTNode.get()) { +if (!Decl->isInitCapture() && ckandeler wrote:

[clang] [clang-tools-extra] [clangd] Collect comments from function definitions into the index (PR #67802)

2024-02-02 Thread Christian Kandeler via cfe-commits
ckandeler wrote: I have removed the extra Symbol member and extended the Flags enum instead. I benchmarked with Qt as the test project (qtbase, to be exact), which is heavily documented and has all its function documentation in the cpp files, so it should provide an upper bound on the effects o

[clang] [clang-tools-extra] [clangd] Collect comments from function definitions into the index (PR #67802)

2024-02-02 Thread Christian Kandeler via cfe-commits
https://github.com/ckandeler updated https://github.com/llvm/llvm-project/pull/67802 >From fb3711aa040aa2a986ed7d0c503042adecc6662a Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Fri, 29 Sep 2023 15:01:58 +0200 Subject: [PATCH] [clangd] Collect comments from function definitions into t

[clang-tools-extra] [clang] [clangd] Collect comments from function definitions into the index (PR #67802)

2024-02-01 Thread Christian Kandeler via cfe-commits
ckandeler wrote: > Ok, I see. (I was confused because nothing in the patch looks at the contents > of `Symbol::DocComment` other than > an `empty()` check; maybe a `bool HasDocComment` flag is sufficient?) Right, we just need to save the information whether there was a doc comment before clan

[clang-tools-extra] [clang] [clangd] Collect comments from function definitions into the index (PR #67802)

2024-02-01 Thread Christian Kandeler via cfe-commits
ckandeler wrote: > Do you have another patch where you use the new `DocComment` field? Is it > for showing in a hover? Yes, it is for showing documentation in a hover. clangd already supports that; it's just that it currently works only if the comments are attached to the declaration. With t

[clang-tools-extra] [clangd] Allow "move function body out-of-line" in non-header files (PR #69704)

2024-02-01 Thread Christian Kandeler via cfe-commits
ckandeler wrote: ping https://github.com/llvm/llvm-project/pull/69704 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Do not offer extraction to variable for decl init expression (PR #69477)

2024-02-01 Thread Christian Kandeler via cfe-commits
ckandeler wrote: ping https://github.com/llvm/llvm-project/pull/69477 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clang] [clangd] Collect comments from function definitions into the index (PR #67802)

2024-02-01 Thread Christian Kandeler via cfe-commits
ckandeler wrote: ping https://github.com/llvm/llvm-project/pull/67802 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Do not offer extraction to variable for decl init expression (PR #69477)

2024-01-11 Thread Christian Kandeler via cfe-commits
ckandeler wrote: The latest patch set addresses all the comments. https://github.com/llvm/llvm-project/pull/69477 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Do not offer extraction to variable for decl init expression (PR #69477)

2024-01-11 Thread Christian Kandeler via cfe-commits
@@ -490,6 +491,13 @@ bool eligibleForExtraction(const SelectionTree::Node *N) { BO->getRHS() == OuterImplicit.ASTNode.get()) return false; } + if (const auto *Decl = Parent->ASTNode.get()) { +if (!Decl->isInitCapture() && ckandeler wrote:

[clang-tools-extra] [clangd] Do not offer extraction to variable for decl init expression (PR #69477)

2024-01-11 Thread Christian Kandeler via cfe-commits
@@ -504,68 +502,6 @@ TEST_F(ExtractVariableTest, Test) { int main() { auto placeholder = []() { return 42; }(); return placeholder ; })cpp"}, - {R"cpp( -template -void foo(Ts ...args) { - auto x = [[ [&args...]() {} ]];

[clang-tools-extra] [clangd] Do not offer extraction to variable for decl init expression (PR #69477)

2024-01-11 Thread Christian Kandeler via cfe-commits
@@ -504,68 +502,6 @@ TEST_F(ExtractVariableTest, Test) { int main() { auto placeholder = []() { return 42; }(); return placeholder ; })cpp"}, - {R"cpp( ckandeler wrote: Done. https://github.com/llvm/llvm-project/pull/69477

[clang-tools-extra] [clangd] Do not offer extraction to variable for decl init expression (PR #69477)

2024-01-11 Thread Christian Kandeler via cfe-commits
@@ -422,8 +422,6 @@ TEST_F(ExtractVariableTest, Test) { int member = 42; }; )cpp"}, - {R"cpp(void f() { auto x = [[ [](){ return 42; }]]; })cpp", ckandeler wrote: Done. https://github.com/llvm/llvm-project/pull/69477 _

[clang-tools-extra] [clangd] Do not offer extraction to variable for decl init expression (PR #69477)

2024-01-11 Thread Christian Kandeler via cfe-commits
@@ -27,10 +27,10 @@ TEST_F(ExtractVariableTest, Test) { return t.b[[a]]r]]([[t.z]])]]; } void f() { - int a = [[5 +]] [[4 * xyz]](); + int a = 5 + [[4 * xyz]](); // multivariable initialization if(1) -int x = [[1

[clang-tools-extra] [clangd] Do not offer extraction to variable for decl init expression (PR #69477)

2024-01-11 Thread Christian Kandeler via cfe-commits
https://github.com/ckandeler updated https://github.com/llvm/llvm-project/pull/69477 >From 0ad973446c970e110f1b9c1213e97a7d3da8 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Wed, 18 Oct 2023 17:24:04 +0200 Subject: [PATCH] [clangd] Do not offer extraction to variable for decl init

[clang-tools-extra] [clangd] Do not offer extraction to variable for decl init expression (PR #69477)

2024-01-08 Thread Christian Kandeler via cfe-commits
@@ -490,6 +491,13 @@ bool eligibleForExtraction(const SelectionTree::Node *N) { BO->getRHS() == OuterImplicit.ASTNode.get()) return false; } + if (const auto *Decl = Parent->ASTNode.get()) { +if (!Decl->isInitCapture() && ckandeler wrote:

  1   2   >