[PATCH] D66221: [clangd] Added highlighting for non type templates.

Johan Vikström via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 16 00:58:00 PDT 2019

jvikstrom marked an inline comment as done.
jvikstrom added inline comments.

Comment at: clang-tools-extra/clangd/SemanticHighlighting.cpp:231
+          if (TP->isFunctionPointerType()) {
+            addToken(Loc, HighlightingKind::Function);
+            return;
ilya-biryukov wrote:
> Why do we special-case template parameters, but not other kinds of variables?
> We definitely need a comment explaining why template parameters are handled in a special way, but variables, parameters, fields are not.
Not quite sure what you mean about variables/parameters/fields not being handled in a special way.

The reason for special casing non type templates is because it probably gives more information/is more valuable to highlight a reference/pointer as a variable rather than a normal template parameter (same for methods/functions).

But maybe they all should just be highlighted as with the TemplateParameter kind instead?

  rG LLVM Github Monorepo



More information about the cfe-commits mailing list