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

Add runtime queries for tfvars (based on hcl) #5396

Merged
merged 1 commit into from
Jan 6, 2023

Conversation

dxmh
Copy link
Contributor

@dxmh dxmh commented Jan 4, 2023

I noticed that the .tfvars files in my Terraform projects don't get syntax highlighting unless I manually run :set-language hcl.

The tfvars language is already configured to use the hcl grammar (since it was separated from hcl in #2244):

helix/languages.toml

Lines 1279 to 1288 in 0dbee95

[[language]]
name = "tfvars"
scope = "source.tfvars"
file-types = ["tfvars"]
roots = []
comment-token = "#"
indent = { tab-width = 2, unit = " " }
language-server = { command = "terraform-ls", args = ["serve"], language-id = "terraform-vars" }
auto-format = true
grammar = "hcl"

So this small PR adds the tfvars files into runtime/queries/, with each simply inheriting from hcl (as advised on Matrix by @archseer).

I've added files to inherit everything from hcl (folds, highlights, indents and injections), though I'm unsure if all are necessary, or if perhaps only highlights.scm should be added. Please let me know if anything needs to be changed.

Thanks!

@the-mikedavis the-mikedavis merged commit 532531c into helix-editor:master Jan 6, 2023
@dxmh dxmh deleted the tfvars-highlighting branch January 6, 2023 13:40
kirawi pushed a commit to kirawi/helix that referenced this pull request Jan 25, 2023
freqmod pushed a commit to freqmod/helix that referenced this pull request Feb 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants