[PATCH] D95701: [clangd] Add semanticTokens modifiers for function/class/file/global scope

Nathan Ridge via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Feb 2 22:56:23 PST 2021


nridge added inline comments.


================
Comment at: clang-tools-extra/clangd/SemanticHighlighting.cpp:466
     case TemplateArgument::TemplateExpansion:
+      // FIXME: I don't understand why this is DependentType.
       H.addToken(L.getTemplateNameLoc(), HighlightingKind::DependentType);
----------------
nridge wrote:
> The testcase which relies on this is this one:
> 
> ```
>       // Dependent template name
>       R"cpp(
>       template <template <typename> class> struct $Class[[A]] {};
>       template <typename $TemplateParameter[[T]]>
>       using $Typedef[[W]] = $Class[[A]]<
>         $TemplateParameter[[T]]::template $DependentType[[Waldo]]
>       >;
> ```
> 
> However, it does appear that we get into here even for non-dependent template template arguments (but then also get a non-dependent highlighting kind via `findExplicitReferences()`, and end up discarding the `DependentType` via `resolveConflict()`).
I see you've already figured this out in D95706 :)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D95701



More information about the cfe-commits mailing list