[PATCH] D64257: [clangd] Added highlighting for non-builtin types

Johan Vikström via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jul 8 07:53:19 PDT 2019


jvikstrom added inline comments.


================
Comment at: clang-tools-extra/clangd/SemanticHighlighting.cpp:73
+    if (auto RD = dyn_cast<CXXRecordDecl>(D)) {
+      if (auto DC = RD->getDestructor()) {
+        auto Range = DC->getSourceRange();
----------------
hokein wrote:
> Here is the case:
> 
> ```
> class Foo {
>    ~Foo
>  // ^~~ we get a TypeLoc whose TagDecl is a cxxRecordDecl.
> }
> ```
> not sure this is expected in clang AST, but it is unreasonable in highlighting context -- ideally, we want to highlight `~Foo` as a destructor (we may encounter a tricky case, like `~ /*comment*/ Foo()`, but I assume this is rarce, should be fine), @sammccall, @ilya-biryukov, thoughts?
Do we want to highlight the entire "~Foo" or only the ~"Foo" for destructors?



Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D64257





More information about the cfe-commits mailing list