hashicorp / hashicorp/syntax

Improve highlighting of primitive type declarations

Open
#27 2 comments 0 reactions 0 assignees View on GitHub
enhancement syntax
Dominant language
HCL
Stars
31
Forks
12
Avg merge
7m
Merged PRs (30d)
1

Description

## Problem Statement

This is to follow up on https://github.com/hashicorp/terraform-ls/pull/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

![Screenshot 2022-03-07 at 12 26 20](https://user-images.githubusercontent.com/287584/157034548-ce14ddd2-2592-4288-8a26-76e4e5a6d3db.png)

### Semantic Highlighting

![Screenshot 2022-03-07 at 12 27 53](https://user-images.githubusercontent.com/287584/157034571-f15ac02c-0de9-4a60-828c-38ebf788d175.png)

## 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?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.