[PATCH] D77811: [clangd] Implement semanticTokens modifiers

Nathan Ridge via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 2 00:39:20 PST 2021


nridge added a comment.

In D77811#2533815 <https://reviews.llvm.org/D77811#2533815>, @sammccall wrote:

> Introducing nonstandard kinds is **backwards-incompatible**. If the client doesn't understand primitiveType, then the token kind is now completely unknown. This could be a regression from the current state (type).

Good point. I guess, if we're aiming for backwards compatibility, we'll want to do most of our future customization via modifiers, since those will gracefully degrade to the highlighting for base kind for clients that don't recongize them.

>> That said... for typedef specifically, I wonder if it actually makes more sense as a modifier than a kind. That is, have the kind be the target type (falling back to Unknown/Dependent if we don't know), and have a modifier flag for "the type is referred to via an alias" (as opposed to "the type is referred to directly"). WDYT?
>
> Agree. Do you think it should be the *same* modifier as `deduced` which I included here?

Conceptually, they seem distinct to me.

> (In a similar vein, there's an argument for pointer, ref, rvalue-ref as modifiers)

Indeed. I'm definitely happy to defer type modifiers like these (including typedef) to a future patch.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D77811



More information about the llvm-commits mailing list