sammccall added inline comments.

================
Comment at: clang-tools-extra/clangd/SemanticHighlighting.cpp:966
+
+    if (auto *TSI = D->getTypeSourceInfo()) {
+       auto ATL = TSI->getTypeLoc().getContainedAutoTypeLoc();
----------------
if we add this logic it definitely needs a comment explaining that we're 
looking for the auto token (because we're not doing so directly) and why


================
Comment at: clang-tools-extra/clangd/SemanticHighlighting.cpp:969
+       if (ATL.isConstrained()) {
+         StartLoc = ATL.getConceptNameInfo().getEndLoc().getLocWithOffset(1);
+       }
----------------
getLocWithOffset(1) is just jumping one byte in the source code
why is this correct?

IIUC the intention here is to jump to the `auto` token, and the AutoTypeLoc 
doesn't actually expose this

I'd suggest:
 - for now just bailing out - this is not important enough to hack around (and 
the current hack doesn't seem robust)
 - if you have the appetite, adding this location to AutoTypeLoc seems like a 
good thing


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D154580

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

Reply via email to