vscode-kotlin icon indicating copy to clipboard operation
vscode-kotlin copied to clipboard

Classify more hard keywords as such in the grammar

Open ks-korovina opened this issue 1 year ago • 0 comments

This is more consistent with how other languages classify tokens, and better compatible with color themes. Also, IntelliJ doesn't make a distinction between different hard keywords, so we likely don't need to, either.

storage.type scope seems to be a better fit for types, not declaration kinds. Examples:

  • Java grammar using storage.type.primitive.array.java for boolean[], storage.type.local.java for its var (which is "type"-y), storage.modifier.java for "class" and keyword.other.package.java for "package".
  • Go grammar using keyword.function.go for func, storage.type.boolean.go for bool.

There is another issue with keywords in this case which I couldn't fix right away: in fun f(a: suspend () -> Unit), suspend is classified as entity.name.type.kotlin. IIUC, this is because somehow we end up in type-parameter rule instead of in keywords.

ks-korovina avatar Feb 06 '24 10:02 ks-korovina