[PATCH] D130015: [clangd] Add "usedAsMutablePointer" highlighting modifier

Christian Kandeler via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 10 04:54:38 PDT 2022


ckandeler added inline comments.


================
Comment at: clang-tools-extra/clangd/SemanticHighlighting.cpp:603
       H.addExtraModifier(*Location,
-                         HighlightingModifier::UsedAsMutableReference);
+                         IsRef ? HighlightingModifier::UsedAsMutableReference
+                               : HighlightingModifier::UsedAsMutablePointer);
----------------
kadircet wrote:
> why do you think we should have different modifiers for these? they both indicate the same thing, the parameter might get mutated by the call, and it being a pointer or reference doesn't seem to matter.
Because I'm aware that there are people (like Nathan) who don't find it useful for pointers, and having just one modifier would force it on everybody. With two distinct modifiers, clients can decide for themselves, possibly even exposing the choice to users.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D130015/new/

https://reviews.llvm.org/D130015



More information about the cfe-commits mailing list