hashicorp / hashicorp/syntax

First segment of references and object contents mis-highlighted

Open
#79 6 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
HCL
Stars
31
Forks
12
Avg merge
7m
Merged PRs (30d)
1

Description

### Extension Version

v2.26.20230511

### VS Code Version

Version: 1.79.1 (user setup)
Commit: 4cb974a7aed77a74c7813bdccd99ee0d04901215
Date: 2023-06-12T16:14:05.102Z
Electron: 22.5.7
Chromium: 108.0.5359.215
Node.js: 16.17.1
V8: 10.8.168.25-electron.0
OS: Windows_NT x64 10.0.19044

### Operating System

Windows 10

### Steps to Reproduce

Setup files as below - note the colours in the ```main.pkr.hcl``` file for:

```
repo = var.GITHUB_REPOSITORY
branch = var.REF_NAME
event_type = var.EVENT_NAME
```

### Expected Behavior

Colours should be correct.

### Actual Behavior

Colours incorrect on lines 12/13/14.

![image](https://github.com/hashicorp/vscode-terraform/assets/61512176/8a18453f-79e3-441e-bb5f-4b6f4a62029b)

### Configuration

file.pkr.hcl

```
source "amazon-ebs" "nat-ubuntu" {
ami_name = "digital-images-nat-ubuntu-${local.timestamp}"
source_ami = data.amazon-ami.nat-ubuntu.id
instance_type = "t4g.micro"
region = "eu-west-1"
ssh_username = "ubuntu"
ami_regions = var.ami_regions

tags = {
base_ami_id = "{{ .SourceAMI }}"
base_ami_name = "{{ .SourceAMIName }}"
repo = var.GITHUB_REPOSITORY
branch = var.REF_NAME
event_type = var.EVENT_NAME
production = var.REF_NAME == "main" ? "true" : "false"
}

vpc_filter {
filters = {
"isDefault" : "false"
}
}
subnet_filter {
filters = {
"tag:Name" : "primary*"
}
random = true
}

ami_users = var.accounts
}
```

variable.pkr.hcl
```
variable "accounts" {
type = list(string)

default = []
}

variable "ami_regions" {
type = list(string)

default = [
"us-east-1",
"eu-central-1",
"eu-west-2",
"sa-east-1",
]
}

variable "GITHUB_REPOSITORY" {
description = "GitHub repo"

type = string

default = "Hogarth-Worldwide/terraform-aws-amis-digital"
}

variable "REF_NAME" {
description = "GitHub branch"

type = string

default = "local_running"
}

variable "EVENT_NAME" {
description = "GitHub event name"

type = string

default = "local_running"
}
```

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.