vscode-kotlin
vscode-kotlin copied to clipboard
Classify more hard keywords as such in the grammar
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
forboolean[]
,storage.type.local.java
for itsvar
(which is "type"-y),storage.modifier.java
for "class" andkeyword.other.package.java
for "package". -
Go grammar using
keyword.function.go
forfunc
,storage.type.boolean.go
forbool
.
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.