Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Copy patterns from HCL grammar to Terraform grammar #17

Merged
merged 2 commits into from
Mar 16, 2022

Conversation

dbanck
Copy link
Member

@dbanck dbanck commented Mar 15, 2022

This PR removes all cross-file include patterns from the Terraform grammar by duplicating the patterns from the HCL grammar.

In an editor of your choice, one can view the Terraform-specific changes best by comparing terraform.tmGrammar.json and hcl.tmGrammar.json.

Before

CleanShot 2022-03-15 at 20 17 16
CleanShot 2022-03-15 at 20 17 07

After

CleanShot 2022-03-15 at 20 16 38
CleanShot 2022-03-15 at 20 15 23

Closes #16

dbanck added 2 commits March 15, 2022 19:54
This resolves an issue with nested include patterns. As soon as an
include hits the HCL grammar file, it would never include anything
from the Terraform grammar file. Because of this, highlighting of
functions would break in deeper nested blocks or function calls.

The commit introduces a lot of code duplication, but it all will go
away with the introduction of templating for grammar files.
@dbanck dbanck added the bug Something isn't working label Mar 15, 2022
@dbanck dbanck added this to the 0.1.0 milestone Mar 15, 2022
@dbanck dbanck self-assigned this Mar 15, 2022
@dbanck dbanck changed the title F copy hcl to terraform Copy patterns from HCL grammar to Terraform grammar Mar 15, 2022
Copy link
Contributor

@jpogran jpogran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚢

@dbanck dbanck merged commit 7742f54 into main Mar 16, 2022
@dbanck dbanck deleted the f-copy-hcl-to-terraform branch March 16, 2022 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Copy HCL grammar patterns to Terraform grammar
2 participants