You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think a more consistent way would be to use storage.type for block types, like variable and support.type for types, like string and make sure to match grammar and semantic tokens:
The main reason is that variable (token type) is already used for traversals and I couldn't think of many other good options in semantic highlighting, other than keyword, bearing in mind the syntax should provide decent out-of-the-box experience without relying on explicit mapping in extension(s).
On that note I'd be curious to see how any language server with semantic highlighting solves this - I'm guessing they get away with e.g. type token because there aren't "block types" unlike in our DSL?
Problem Statement
This is to follow up on hashicorp/terraform-ls#827 which introduces semantic highlighting of type declarations.
Type declarations are highlighted by the server as
keyword
.Our grammar currently highlights them as
storage.type
which seems to result in a different association in the default VSCode themes.https://github.com/hashicorp/vscode-terraform/blob/c8b0154b8d2cc4cd67b4e68065ad6b85f8e133a8/syntaxes/terraform.tmGrammar.json#L49-L53
Grammar (only) Highlighting
Semantic Highlighting
Expected User Experience
Grammar and semantic highlighting are more aligned, i.e. type declarations are highlighted as keywords in the grammar too.
Proposal
Update
terraform_type_keywords
matcher?The text was updated successfully, but these errors were encountered: