sammccall added inline comments.

================
Comment at: clang-tools-extra/clangd/Selection.cpp:613
       // int (*[[s]])();
-      else if (auto *VD = llvm::dyn_cast<VarDecl>(D))
-        return VD->getLocation();
+      if (auto *DD = llvm::dyn_cast<DeclaratorDecl>(D))
+        return DD->getLocation();
----------------
I think we can combine these two cases.
The weird cases handled by FunctionDecl are actually a bit wrong at the moment 
(early claiming types).
 - conversion operator: we should probably be claiming `operator` only, which 
hapepns to be getLocation()
 - destructor: we should be claiming ~ only, which is also getLocation()
 - constructor: we shouldn't be claiming anything, need to blacklist
 - all the others seem fine to be handled by the DeclaratorDecl case

This changes more behaviour (and the changes are likely to be seen as 
regressions in some cases, though more consistent) so we could also consider 
just landing this as-is.


================
Comment at: clang-tools-extra/clangd/unittests/SelectionTests.cpp:374
+          R"cpp(
+            // We've got this nice trick, as annotation library eagerly selects
+            // the range and if we've got [32] below, there's no way to select
----------------
I'd suggest using digraphs instead, if it works:

`int hash<:32:>`


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D75106



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to