From 9d1d11a2743c4057ce2b181aa18fd568579700a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=B6hl=2C=20Lukas?= Date: Sat, 23 Apr 2022 22:24:29 +0200 Subject: [PATCH 1/3] fix(lsp): divide hcl into hcl and tfvars --- languages.toml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/languages.toml b/languages.toml index 3b2eedf2c37d..49304a5cea07 100644 --- a/languages.toml +++ b/languages.toml @@ -1038,17 +1038,31 @@ source = { git = "https://github.com/fwcd/tree-sitter-kotlin", rev = "a4f71eb9b8 name = "hcl" scope = "source.hcl" injection-regex = "(hcl|tf|nomad)" -file-types = ["hcl", "tf", "tfvars", "nomad"] +file-types = ["hcl", "tf", "nomad"] roots = [] comment-token = "#" indent = { tab-width = 2, unit = " " } -language-server = { command = "terraform-ls", args = ["serve"] } +language-server = { command = "terraform-ls", args = ["serve"], language-id = "terraform" } auto-format = true [[grammar]] name = "hcl" source = { git = "https://github.com/MichaHoffmann/tree-sitter-hcl", rev = "3cb7fc28247efbcb2973b97e71c78838ad98a583" } +[[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]] +name = "tfvars" +source = { git = "https://github.com/MichaHoffmann/tree-sitter-hcl", rev = "3cb7fc28247efbcb2973b97e71c78838ad98a583" } + [[language]] name = "org" scope = "source.org" From 5249e074de13d0150aeeeedef82f360c923f6edd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=B6hl=2C=20Lukas?= Date: Sat, 23 Apr 2022 22:28:37 +0200 Subject: [PATCH 2/3] docs(lsp): regenerate lang-support --- book/src/generated/lang-support.md | 1 + 1 file changed, 1 insertion(+) diff --git a/book/src/generated/lang-support.md b/book/src/generated/lang-support.md index 7292b61bae3f..68e6c8d71b18 100644 --- a/book/src/generated/lang-support.md +++ b/book/src/generated/lang-support.md @@ -73,6 +73,7 @@ | svelte | ✓ | | ✓ | `svelteserver` | | swift | ✓ | | | `sourcekit-lsp` | | tablegen | ✓ | ✓ | ✓ | | +| tfvars | | | | `terraform-ls` | | toml | ✓ | | | | | tsq | ✓ | | | | | tsx | ✓ | | | `typescript-language-server` | From 210cdcb49581b275af4706a4e7687e6b0dbaa82a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=B6hl=2C=20Lukas?= Date: Sat, 23 Apr 2022 23:01:39 +0200 Subject: [PATCH 3/3] chore(lsp): reuse hcl grammar for tfvars --- languages.toml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/languages.toml b/languages.toml index 49304a5cea07..f04d0d0159e5 100644 --- a/languages.toml +++ b/languages.toml @@ -1058,10 +1058,7 @@ comment-token = "#" indent = { tab-width = 2, unit = " " } language-server = { command = "terraform-ls", args = ["serve"], language-id = "terraform-vars" } auto-format = true - -[[grammar]] -name = "tfvars" -source = { git = "https://github.com/MichaHoffmann/tree-sitter-hcl", rev = "3cb7fc28247efbcb2973b97e71c78838ad98a583" } +grammar = "hcl" [[language]] name = "org"