[clang-tools-extra] [clangd] Add 'apply all clangd fixes' and 'apply all '_' fixes' QuickFixes (PR #79867)

2025-05-20 Thread Tor Shepherd via cfe-commits
torshepherd wrote: It's been a while since I looked at this, but from what I remember my attempt to fix the last part didn't quite work as expected. I can try to test it again, but I ended up just abandoning it at the time since I didn't really miss the functionality as much as I thought http

[clang-tools-extra] [clangd] Add inlay hints for default function arguments (PR #95712)

2024-10-19 Thread Tor Shepherd via cfe-commits
torshepherd wrote: Accepted the comment and added relnotes. Lmk if you need anything else prior to merge https://github.com/llvm/llvm-project/pull/95712 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/lis

[clang-tools-extra] [clangd] Add inlay hints for default function arguments (PR #95712)

2024-10-19 Thread Tor Shepherd via cfe-commits
https://github.com/torshepherd updated https://github.com/llvm/llvm-project/pull/95712 >From ee08d8cc7760fe39637260408aec2b1e6ab30d0a Mon Sep 17 00:00:00 2001 From: Tor Shepherd Date: Mon, 23 Sep 2024 23:12:23 -0400 Subject: [PATCH 1/7] just defaults --- clang-tools-extra/clangd/Config.h

[clang-tools-extra] [clangd] Add inlay hints for default function arguments (PR #95712)

2024-10-19 Thread Tor Shepherd via cfe-commits
https://github.com/torshepherd updated https://github.com/llvm/llvm-project/pull/95712 >From 2c9e7c16524b7ce3bf818e451279722dc45d3efc Mon Sep 17 00:00:00 2001 From: Tor Shepherd Date: Mon, 23 Sep 2024 23:12:23 -0400 Subject: [PATCH 1/6] just defaults --- clang-tools-extra/clangd/Config.h

[clang-tools-extra] [clangd] Add inlay hints for default function arguments (PR #95712)

2024-10-14 Thread Tor Shepherd via cfe-commits
https://github.com/torshepherd updated https://github.com/llvm/llvm-project/pull/95712 >From 2c9e7c16524b7ce3bf818e451279722dc45d3efc Mon Sep 17 00:00:00 2001 From: Tor Shepherd Date: Mon, 23 Sep 2024 23:12:23 -0400 Subject: [PATCH 1/5] just defaults --- clang-tools-extra/clangd/Config.h

[clang-tools-extra] [clangd] Add inlay hints for default function arguments (PR #95712)

2024-10-14 Thread Tor Shepherd via cfe-commits
torshepherd wrote: Ok I found a couple of nontrivial issues that I took care of in the latest commit. 1. Using `DefaultArguments` required having parameter names set to true as well. I separated them so that both have a modality that works with or without the other. See screenshot for default

[clang-tools-extra] [clangd] Add inlay hints for default function arguments (PR #95712)

2024-10-08 Thread Tor Shepherd via cfe-commits
torshepherd wrote: Ping https://github.com/llvm/llvm-project/pull/95712 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [llvm] [clangd] Add CodeAction to swap operands to binary operators (PR #78999)

2024-10-02 Thread Tor Shepherd via cfe-commits
torshepherd wrote: I'll try to rectify this; for now you can add tor [dot] aksel [dot] shepherd [at] gmail [dot] com https://github.com/llvm/llvm-project/pull/78999 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bi

[clang-tools-extra] [llvm] [clangd] Add CodeAction to swap operands to binary operators (PR #78999)

2024-10-01 Thread Tor Shepherd via cfe-commits
torshepherd wrote: @5chmidti this should be ready for merge https://github.com/llvm/llvm-project/pull/78999 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Add inlay hints for default function arguments (PR #95712)

2024-09-30 Thread Tor Shepherd via cfe-commits
https://github.com/torshepherd updated https://github.com/llvm/llvm-project/pull/95712 >From 2c9e7c16524b7ce3bf818e451279722dc45d3efc Mon Sep 17 00:00:00 2001 From: Tor Shepherd Date: Mon, 23 Sep 2024 23:12:23 -0400 Subject: [PATCH 1/4] just defaults --- clang-tools-extra/clangd/Config.h

[clang-tools-extra] [clangd] Add inlay hints for default function arguments (PR #95712)

2024-09-30 Thread Tor Shepherd via cfe-commits
@@ -755,12 +812,33 @@ class InlayHintVisitor : public RecursiveASTVisitor { bool NameHint = shouldHintName(Args[I], Name); bool ReferenceHint = shouldHintReference(Params[I], ForwardedParams[I]); + bool IsDefault = isa(Args[I]); torshepherd w

[clang-tools-extra] [clangd] Add inlay hints for default function arguments (PR #95712)

2024-09-30 Thread Tor Shepherd via cfe-commits
torshepherd wrote: > Hmm another case to consider: > > ![image](https://private-user-images.githubusercontent.com/49597791/372187742-193c9570-0e6b-47cd-8d8c-0279e727eac2.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6I

[clang-tools-extra] [clangd] Add inlay hints for default function arguments (PR #95712)

2024-09-30 Thread Tor Shepherd via cfe-commits
https://github.com/torshepherd updated https://github.com/llvm/llvm-project/pull/95712 >From 2c9e7c16524b7ce3bf818e451279722dc45d3efc Mon Sep 17 00:00:00 2001 From: Tor Shepherd Date: Mon, 23 Sep 2024 23:12:23 -0400 Subject: [PATCH 1/3] just defaults --- clang-tools-extra/clangd/Config.h

[clang-tools-extra] [clangd] Add inlay hints for default function arguments (PR #95712)

2024-09-30 Thread Tor Shepherd via cfe-commits
https://github.com/torshepherd updated https://github.com/llvm/llvm-project/pull/95712 >From 2c9e7c16524b7ce3bf818e451279722dc45d3efc Mon Sep 17 00:00:00 2001 From: Tor Shepherd Date: Mon, 23 Sep 2024 23:12:23 -0400 Subject: [PATCH 1/2] just defaults --- clang-tools-extra/clangd/Config.h

[clang-tools-extra] [clangd] Add inlay hints for default function arguments (PR #95712)

2024-09-30 Thread Tor Shepherd via cfe-commits
torshepherd wrote: Hmm another case to consider: ![image](https://github.com/user-attachments/assets/193c9570-0e6b-47cd-8d8c-0279e727eac2) In this case the argument is unnamed. I think for this I should just insert `/* unused */` or `/* unnamed */` ? https://github.com/llvm/llvm-project/pull/

[clang-tools-extra] [clangd] Implement simple folding of preprocessor branches (PR #80592)

2024-09-28 Thread Tor Shepherd via cfe-commits
torshepherd wrote: Darn, this was just closed last week as I put up an issue https://github.com/llvm/llvm-project/issues/110390 😭 Clang-pseudo was just removed: https://github.com/llvm/llvm-project/pull/80081#issuecomment-2361060164 Is the plan to refactor now and re-put this up? https://g

[clang-tools-extra] [clangd] Add inlay hints for default function arguments (PR #95712)

2024-09-28 Thread Tor Shepherd via cfe-commits
https://github.com/torshepherd edited https://github.com/llvm/llvm-project/pull/95712 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Add inlay hints for default function arguments (PR #95712)

2024-09-28 Thread Tor Shepherd via cfe-commits
https://github.com/torshepherd edited https://github.com/llvm/llvm-project/pull/95712 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Add inlay hints for default function arguments (PR #95712)

2024-09-23 Thread Tor Shepherd via cfe-commits
https://github.com/torshepherd updated https://github.com/llvm/llvm-project/pull/95712 >From 2c9e7c16524b7ce3bf818e451279722dc45d3efc Mon Sep 17 00:00:00 2001 From: Tor Shepherd Date: Mon, 23 Sep 2024 23:12:23 -0400 Subject: [PATCH] just defaults --- clang-tools-extra/clangd/Config.h

[clang-tools-extra] [clangd] Add inlay hints for default function arguments (PR #95712)

2024-09-23 Thread Tor Shepherd via cfe-commits
https://github.com/torshepherd edited https://github.com/llvm/llvm-project/pull/95712 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [llvm] [clangd] Add CodeAction to swap operands to binary operators (PR #78999)

2024-09-23 Thread Tor Shepherd via cfe-commits
https://github.com/torshepherd updated https://github.com/llvm/llvm-project/pull/78999 >From 718e26db063980e2296f3817381befc119294b64 Mon Sep 17 00:00:00 2001 From: Tor Shepherd Date: Sun, 21 Jan 2024 17:53:31 -0500 Subject: [PATCH 1/3] [clangd] Swap binary operands --- .../clangd/refactor/tw

[clang-tools-extra] [llvm] [clangd] Add CodeAction to swap operands to binary operators (PR #78999)

2024-09-23 Thread Tor Shepherd via cfe-commits
torshepherd wrote: > Could you add a release note for this as well? > > * please bring the branch up to date with main Where do I add clangd release notes? https://github.com/llvm/llvm-project/pull/78999 ___ cfe-commits mailing list cfe-commits@l

[clang-tools-extra] [llvm] [clangd] Add CodeAction to swap operands to binary operators (PR #78999)

2024-09-23 Thread Tor Shepherd via cfe-commits
https://github.com/torshepherd updated https://github.com/llvm/llvm-project/pull/78999 >From 718e26db063980e2296f3817381befc119294b64 Mon Sep 17 00:00:00 2001 From: Tor Shepherd Date: Sun, 21 Jan 2024 17:53:31 -0500 Subject: [PATCH] [clangd] Swap binary operands --- .../clangd/refactor/tweaks

[clang-tools-extra] [clangd] Add inlay hints for default function arguments and implicit lambda captures (PR #95712)

2024-07-01 Thread Tor Shepherd via cfe-commits
https://github.com/torshepherd updated https://github.com/llvm/llvm-project/pull/95712 >From 07e5dcc71dc20c9d7482fc076cbeeb5e97a797d7 Mon Sep 17 00:00:00 2001 From: Tor Shepherd Date: Wed, 19 Jun 2024 09:55:34 -0400 Subject: [PATCH 1/2] after comments --- clang-tools-extra/clangd/Config.h

[clang-tools-extra] [clangd] Add inlay hints for default function arguments and implicit lambda captures (PR #95712)

2024-06-19 Thread Tor Shepherd via cfe-commits
torshepherd wrote: Ok I took a stab at doing lambda captures as hover instead. - Targeting the exact '=' or '&' is nontrivial since the capture list isn't in the AST, the lambda is just `LambdaExpr` with children for the parameters and the CompoundStmt body. - `auto MyLambda = [...` already pr

[clang-tools-extra] [clangd] Add inlay hints for default function arguments and implicit lambda captures (PR #95712)

2024-06-19 Thread Tor Shepherd via cfe-commits
https://github.com/torshepherd updated https://github.com/llvm/llvm-project/pull/95712 >From 3830a49faf5e20781f864d459f5478221740ac3d Mon Sep 17 00:00:00 2001 From: Tor Shepherd Date: Wed, 19 Jun 2024 09:55:34 -0400 Subject: [PATCH 1/2] after comments --- clang-tools-extra/clangd/Config.h

[clang-tools-extra] [clangd] Add inlay hints for default function arguments and implicit lambda captures (PR #95712)

2024-06-19 Thread Tor Shepherd via cfe-commits
https://github.com/torshepherd updated https://github.com/llvm/llvm-project/pull/95712 >From 3830a49faf5e20781f864d459f5478221740ac3d Mon Sep 17 00:00:00 2001 From: Tor Shepherd Date: Wed, 19 Jun 2024 09:55:34 -0400 Subject: [PATCH 1/2] after comments --- clang-tools-extra/clangd/Config.h

[clang-tools-extra] [clangd] Add inlay hints for default function arguments and implicit lambda captures (PR #95712)

2024-06-19 Thread Tor Shepherd via cfe-commits
@@ -372,6 +382,34 @@ maybeDropCxxExplicitObjectParameters(ArrayRef Params) { return Params; } +llvm::StringRef getLambdaCaptureName(const LambdaCapture &Capture) { + if (Capture.capturesVariable()) +return Capture.getCapturedVar()->getName(); + if (Capture.capturesThis

[clang-tools-extra] [clangd] Add inlay hints for default function arguments and implicit lambda captures (PR #95712)

2024-06-19 Thread Tor Shepherd via cfe-commits
@@ -372,6 +382,34 @@ maybeDropCxxExplicitObjectParameters(ArrayRef Params) { return Params; } +llvm::StringRef getLambdaCaptureName(const LambdaCapture &Capture) { + if (Capture.capturesVariable()) +return Capture.getCapturedVar()->getName(); + if (Capture.capturesThis

[clang-tools-extra] [clangd] Add inlay hints for default function arguments and implicit lambda captures (PR #95712)

2024-06-19 Thread Tor Shepherd via cfe-commits
@@ -15,9 +15,12 @@ #include "support/Context.h" #include "llvm/ADT/StringRef.h" #include "llvm/Support/ScopedPrinter.h" +#include "llvm/Support/raw_ostream.h" #include "gmock/gmock.h" #include "gtest/gtest.h" +#include #include +#include torshepherd wrote

[clang-tools-extra] [clangd] Add inlay hints for default function arguments and implicit lambda captures (PR #95712)

2024-06-19 Thread Tor Shepherd via cfe-commits
https://github.com/torshepherd updated https://github.com/llvm/llvm-project/pull/95712 >From 3830a49faf5e20781f864d459f5478221740ac3d Mon Sep 17 00:00:00 2001 From: Tor Shepherd Date: Wed, 19 Jun 2024 09:55:34 -0400 Subject: [PATCH 1/2] after comments --- clang-tools-extra/clangd/Config.h

[clang-tools-extra] [clangd] Add inlay hints for default function arguments and implicit lambda captures (PR #95712)

2024-06-19 Thread Tor Shepherd via cfe-commits
https://github.com/torshepherd updated https://github.com/llvm/llvm-project/pull/95712 >From 77bb21454b2110bed491689a4c323cff1c745207 Mon Sep 17 00:00:00 2001 From: Tor Shepherd Date: Sun, 16 Jun 2024 10:54:43 -0400 Subject: [PATCH] Add default arguments and lambda captures only --- clang-too

[clang-tools-extra] [clangd] Add inlay hints for default function arguments and implicit lambda captures (PR #95712)

2024-06-17 Thread Tor Shepherd via cfe-commits
@@ -504,10 +503,10 @@ struct FragmentCompiler { auto Fast = isFastTidyCheck(Str); if (!Fast.has_value()) { diag(Warning, - llvm::formatv( - "Latency of clang-tidy check '{0}' is not known. " - "It will only run if

[clang-tools-extra] [clangd] Add inlay hints for default function arguments and implicit lambda captures (PR #95712)

2024-06-17 Thread Tor Shepherd via cfe-commits
@@ -1568,7 +1626,7 @@ TEST(TypeHints, SubstTemplateParameterAliases) { )cpp"; llvm::StringRef VectorIntPtr = R"cpp( -vector array; +vector $init[[array]]; torshepherd wrote: Another artifact, sorry https://github.com/llvm/llvm-project/pull/95712

[clang-tools-extra] [clangd] Add inlay hints for default function arguments and implicit lambda captures (PR #95712)

2024-06-17 Thread Tor Shepherd via cfe-commits
@@ -1458,13 +1463,66 @@ TEST(TypeHints, DefaultTemplateArgs) { struct A {}; A foo(); auto $var[[var]] = foo(); -A bar[1]; +A baz; +A bar[1]{}; torshepherd wrote: My fault, an artifact from a different set of inlay hints I decided not to

[clang-tools-extra] [clangd] Add inlay hints for default function arguments and implicit lambda captures (PR #95712)

2024-06-17 Thread Tor Shepherd via cfe-commits
@@ -15,9 +15,12 @@ #include "support/Context.h" #include "llvm/ADT/StringRef.h" #include "llvm/Support/ScopedPrinter.h" +#include "llvm/Support/raw_ostream.h" #include "gmock/gmock.h" #include "gtest/gtest.h" +#include #include +#include torshepherd wrote

[clang-tools-extra] [clangd] Add inlay hints for default function arguments and implicit lambda captures (PR #95712)

2024-06-17 Thread Tor Shepherd via cfe-commits
torshepherd wrote: Aha, that's a great suggestion. I agree that beyond the trivial case of 2 captured variables it gets a bit noisy. On-hover would be quite nice though! To clarify, you mean hovering over the default capture '=' or '&' right? I'm happy to remove the lambdas from this PR in fav

[clang-tools-extra] [clangd] Add inlay hints for default function arguments and implicit lambda captures (PR #95712)

2024-06-16 Thread Tor Shepherd via cfe-commits
https://github.com/torshepherd created https://github.com/llvm/llvm-project/pull/95712 Title. This PR adds support for showing implicit lambda captures: ![image](https://github.com/llvm/llvm-project/assets/49597791/d0150817-f71e-4971-8d8b-e25d2b1e8bf8) and defaulted function arguments: ![imag

[clang-tools-extra] [clangd] Add 'apply all clangd fixes' and 'apply all '_' fixes' QuickFixes (PR #79867)

2024-06-14 Thread Tor Shepherd via cfe-commits
torshepherd wrote: @HighCommander4 I've pushed up the change that doesn't allow conflicting fixits. I'll now be smoke-testing this over the coming weeks while I work, but consider it ready for review again whenever you have a chance https://github.com/llvm/llvm-project/pull/79867 _

[clang-tools-extra] [clangd] Add 'apply all clangd fixes' and 'apply all '_' fixes' QuickFixes (PR #79867)

2024-06-14 Thread Tor Shepherd via cfe-commits
https://github.com/torshepherd updated https://github.com/llvm/llvm-project/pull/79867 >From 94dee94becb7d79b087e183754602e08a5c4669d Mon Sep 17 00:00:00 2001 From: Tor Shepherd Date: Mon, 29 Jan 2024 11:44:25 -0500 Subject: [PATCH 1/2] [clangd] Add fix-all CodeActions --- clang-tools-extra/c

[clang-tools-extra] [clangd] Add 'apply all clangd fixes' and 'apply all '_' fixes' QuickFixes (PR #79867)

2024-05-04 Thread Tor Shepherd via cfe-commits
torshepherd wrote: Ah, awesome. In that case note that I'll make the option not show up when changes would have conflicting overlap ranges https://github.com/llvm/llvm-project/pull/79867 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://

[clang-tools-extra] [llvm] [clangd] Add CodeAction to swap operands to binary operators (PR #78999)

2024-05-04 Thread Tor Shepherd via cfe-commits
torshepherd wrote: Ping https://github.com/llvm/llvm-project/pull/78999 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Add 'apply all clangd fixes' and 'apply all '_' fixes' QuickFixes (PR #79867)

2024-05-04 Thread Tor Shepherd via cfe-commits
torshepherd wrote: Bump @HighCommander4 - did you get a chance to review this? I've been using this with great success in my local build for several months now, and the feature is _extremely_ handy. There is a slight bug that overlapping fixes are troublesome if you choose "clangd apply all",

[clang-tools-extra] [clangd] Add 'apply all clangd fixes' and 'apply all '_' fixes' QuickFixes (PR #79867)

2024-02-27 Thread Tor Shepherd via cfe-commits
https://github.com/torshepherd updated https://github.com/llvm/llvm-project/pull/79867 >From 94dee94becb7d79b087e183754602e08a5c4669d Mon Sep 17 00:00:00 2001 From: Tor Shepherd Date: Mon, 29 Jan 2024 11:44:25 -0500 Subject: [PATCH] [clangd] Add fix-all CodeActions --- clang-tools-extra/clang

[clang-tools-extra] [clangd] Add 'apply all clangd fixes' and 'apply all '_' fixes' QuickFixes (PR #79867)

2024-02-13 Thread Tor Shepherd via cfe-commits
torshepherd wrote: Ping https://github.com/llvm/llvm-project/pull/79867 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [llvm] [clangd] Add CodeAction to swap operands to binary operators (PR #78999)

2024-02-11 Thread Tor Shepherd via cfe-commits
https://github.com/torshepherd updated https://github.com/llvm/llvm-project/pull/78999 >From 6abe2b5af090329bfca42d144597fbd5ca41d511 Mon Sep 17 00:00:00 2001 From: Tor Shepherd Date: Sun, 21 Jan 2024 17:53:31 -0500 Subject: [PATCH] [clangd] Swap binary operands --- .../clangd/refactor/tweaks

[clang-tools-extra] [clangd] Add 'apply all clangd fixes' and 'apply all '_' fixes' QuickFixes (PR #79867)

2024-02-11 Thread Tor Shepherd via cfe-commits
https://github.com/torshepherd updated https://github.com/llvm/llvm-project/pull/79867 >From 636e8286b38839c9d90e9eb147ba59d588c3241c Mon Sep 17 00:00:00 2001 From: Tor Shepherd Date: Mon, 29 Jan 2024 11:44:25 -0500 Subject: [PATCH] [clangd] Add fix-all CodeActions --- clang-tools-extra/clang

[llvm] [clang] [clang-tools-extra] [clangd] Add CodeAction to swap operands to binary operators (PR #78999)

2024-02-04 Thread Tor Shepherd via cfe-commits
https://github.com/torshepherd updated https://github.com/llvm/llvm-project/pull/78999 >From c22c4fc969af0860b1fb2c371d31c2757da70e01 Mon Sep 17 00:00:00 2001 From: Tor Shepherd Date: Sun, 21 Jan 2024 17:53:31 -0500 Subject: [PATCH 1/2] swap binary --- .../clangd/refactor/tweaks/CMakeLists.tx

[clang-tools-extra] [clangd] Add 'apply all clangd fixes' and 'apply all '_' fixes' QuickFixes (PR #79867)

2024-02-04 Thread Tor Shepherd via cfe-commits
torshepherd wrote: Also pinging @kadircet who recently worked on Include Cleaner's similar batch fixes https://github.com/llvm/llvm-project/pull/79867 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listi

[clang-tools-extra] [clangd] Add 'apply all clangd fixes' and 'apply all '_' fixes' QuickFixes (PR #79867)

2024-02-01 Thread Tor Shepherd via cfe-commits
https://github.com/torshepherd updated https://github.com/llvm/llvm-project/pull/79867 >From 7cb9e7b604a16414f31309b59747abbd7d3c0025 Mon Sep 17 00:00:00 2001 From: Tor Shepherd Date: Mon, 29 Jan 2024 11:44:25 -0500 Subject: [PATCH] [clangd] Add fix-all CodeActions --- clang-tools-extra/clang

[clang-tools-extra] [clangd] Add 'apply all clangd fixes' and 'apply all '_' fixes' QuickFixes (PR #79867)

2024-01-30 Thread Tor Shepherd via cfe-commits
https://github.com/torshepherd updated https://github.com/llvm/llvm-project/pull/79867 >From 0ed7667a5b48064a492f7f125a4002912a35fec7 Mon Sep 17 00:00:00 2001 From: Tor Shepherd Date: Mon, 29 Jan 2024 11:44:25 -0500 Subject: [PATCH 1/2] initial cut --- clang-tools-extra/clangd/Diagnostics.cpp

[clang-tools-extra] [clangd] Add 'apply all clangd fixes' and 'apply all '_' fixes' QuickFixes (PR #79867)

2024-01-30 Thread Tor Shepherd via cfe-commits
https://github.com/torshepherd edited https://github.com/llvm/llvm-project/pull/79867 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Add 'apply all clangd fixes' and 'apply all '_' fixes' QuickFixes (PR #79867)

2024-01-30 Thread Tor Shepherd via cfe-commits
https://github.com/torshepherd edited https://github.com/llvm/llvm-project/pull/79867 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Add 'apply all clangd fixes' and 'apply all '_' fixes' QuickFixes (PR #79867)

2024-01-30 Thread Tor Shepherd via cfe-commits
torshepherd wrote: Hmm I noticed another mini-issue. Ideally we shouldn't have a 'fix all clangd' quick fix if all of the issues come from the same source, only the 'fix all _' option https://github.com/llvm/llvm-project/pull/79867 ___ cfe-commits ma

[clang-tools-extra] [clangd] Add 'apply all clangd fixes' and 'apply all '_' fixes' QuickFixes (PR #79867)

2024-01-29 Thread Tor Shepherd via cfe-commits
torshepherd wrote: Also, I noticed that the conversion function `toCodeAction(const Fix& F, ...)` specifically hardcodes all Fix objects to `QUICKFIX_KIND`. When we do https://github.com/clangd/clangd/issues/1446, it would be good to add a string for `SOURCE_FIX_ALL_KIND` and set these fix-all

[clang-tools-extra] [clangd] Add 'apply all clangd fixes' and 'apply all '_' fixes' QuickFixes (PR #79867)

2024-01-29 Thread Tor Shepherd via cfe-commits
torshepherd wrote: Another thing that would be nice to solve in a follow-up (applies to unused includes as well btw) is to clean up the list of fixes when someone selects all and presses quick fix: ![image](https://github.com/llvm/llvm-project/assets/49597791/974d1426-0b8d-41f7-8532-0a5b454e3a

[clang-tools-extra] [clangd] Add 'apply all clangd fixes' and 'apply all '_' fixes' QuickFixes (PR #79867)

2024-01-29 Thread Tor Shepherd via cfe-commits
https://github.com/torshepherd created https://github.com/llvm/llvm-project/pull/79867 This PR adds the following features 1. If there are at least 2 distinct fixable diagnostics stemming from either `clang` or `clang-tidy` overall and their edits are distinct as well, we add a Fix to each on

[clang-tools-extra] [clangd] Attempt to fix https://github.com/clangd/clangd/issues/1536 (PR #79448)

2024-01-28 Thread Tor Shepherd via cfe-commits
torshepherd wrote: I'll close this patch and pursue the other things we discussed https://github.com/llvm/llvm-project/pull/79448 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [clangd] Attempt to fix https://github.com/clangd/clangd/issues/1536 (PR #79448)

2024-01-28 Thread Tor Shepherd via cfe-commits
https://github.com/torshepherd closed https://github.com/llvm/llvm-project/pull/79448 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[llvm] [clang-tools-extra] [clangd] Add CodeAction to swap operands to binary operators (PR #78999)

2024-01-26 Thread Tor Shepherd via cfe-commits
@@ -0,0 +1,210 @@ +//===--- SwapBinaryOperands.cpp --*- C++-*-===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Ap

[clang-tools-extra] [clangd] Attempt to fix https://github.com/clangd/clangd/issues/1536 (PR #79448)

2024-01-25 Thread Tor Shepherd via cfe-commits
https://github.com/torshepherd created https://github.com/llvm/llvm-project/pull/79448 This PR attempts to fix [1536.](https://github.com/clangd/clangd/issues/1536). See in the unit tests, when all quick fixes are of the same `code`, `isPreferred` will be true. However, this doesn't seem to ch

[llvm] [clang-tools-extra] [clangd] Add CodeAction to swap operands to binary operators (PR #78999)

2024-01-24 Thread Tor Shepherd via cfe-commits
https://github.com/torshepherd updated https://github.com/llvm/llvm-project/pull/78999 >From c22c4fc969af0860b1fb2c371d31c2757da70e01 Mon Sep 17 00:00:00 2001 From: Tor Shepherd Date: Sun, 21 Jan 2024 17:53:31 -0500 Subject: [PATCH 1/2] swap binary --- .../clangd/refactor/tweaks/CMakeLists.tx

[llvm] [clang-tools-extra] [clangd] Add CodeAction to swap operands to binary operators (PR #78999)

2024-01-22 Thread Tor Shepherd via cfe-commits
https://github.com/torshepherd created https://github.com/llvm/llvm-project/pull/78999 This MR resolves https://github.com/llvm/llvm-project/issues/78998 >From c22c4fc969af0860b1fb2c371d31c2757da70e01 Mon Sep 17 00:00:00 2001 From: Tor Shepherd Date: Sun, 21 Jan 2024 17:53:31 -0500 Subject: [P