[PATCH] D67901: [clangd] Improve semantic highlighting in dependent contexts (fixes #154)

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 2 06:34:21 PDT 2019


hokein added inline comments.


================
Comment at: clang-tools-extra/clangd/SemanticHighlighting.cpp:505
+  case HighlightingKind::DependentType:
+    return "entity.name.type.dependent.cpp";
+  case HighlightingKind::DependentName:
----------------
ilya-biryukov wrote:
> Maybe have a separate category for all dependent entities instead, i.e. use
> `entity.name.dependent.type.cpp` and `entity.name.dependent.other.cpp`?
> 
> This would allow to specify a single highlighting for both names by stopping at `dependent` subcategory.
> I'm not sure how this plays into the default colors provided in the editors that support semantic highlighting...
Having a dedicate dependent entity doesn't align with the existing textmate patterns (the `dependent` type should be under the `entity.name.type` umbrella) --  most highlighters don't have a specific pattern for `dependent`, so we'll fallback to the `entity.name.type` color. If we use `entity.name.dependent.type.cpp`, we'll fall back to `entity.name` color.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D67901





More information about the cfe-commits mailing list