Configuration problem for HCL/Terraform-ls according documentaiton #7887
-
SummaryI tried to configure LSP for Terraform according to example config. But got stuck on two things:
I skip this message by pressing ENTER and LSP is working as it should including autocompletion. My [[language]]
name = "hcl"
scope = "source.hcl"
injection-regex = "(hcl|tf|nomad)"
language-id = "terraform"
file-types = ["hcl", "tf", "nomad"]
roots = []
comment-token = "#"
indent = { tab-width = 2, unit = " " }
language-server = { command = 'terraform-ls', args = [ "serve" ] }
# language-servers = [ "terraform-ls" ]
auto-format = true
[[grammar]]
name = "hcl"
source = { git = "https://github.com/MichaHoffmann/tree-sitter-hcl", rev = "3cb7fc28247efbcb2973b97e71c78838ad98a583" }
[[language]]
name = "tfvars"
scope = "source.tfvars"
language-id = "terraform-vars"
file-types = ["tfvars"]
roots = []
comment-token = "#"
indent = { tab-width = 2, unit = " " }
language-server = { command = 'terraform-ls', args = [ "serve" ] }
# language-servers = [ "terraform-ls" ]
auto-format = true
grammar = "hcl"
My [[language]]
name = "hcl"
scope = "source.hcl"
injection-regex = "(hcl|tf|nomad)"
# language-id = "terraform"
file-types = ["hcl", "tf", "nomad"]
roots = []
comment-token = "#"
indent = { tab-width = 2, unit = " " }
language-server = { command = 'terraform-ls', args = [ "serve" ] }
# language-servers = [ "terraform-ls" ]
auto-format = true
[[grammar]]
name = "hcl"
source = { git = "https://github.com/MichaHoffmann/tree-sitter-hcl", rev = "3cb7fc28247efbcb2973b97e71c78838ad98a583" }
[[language]]
name = "tfvars"
scope = "source.tfvars"
# language-id = "terraform-vars"
file-types = ["tfvars"]
roots = []
comment-token = "#"
indent = { tab-width = 2, unit = " " }
language-server = { command = 'terraform-ls', args = [ "serve" ] }
# language-servers = [ "terraform-ls" ]
auto-format = true
grammar = "hcl"
Reproduction StepsNo response Helix logLog for 1. step:
Log for 2. step:
PlatformMacOS Terminal EmulatorHyper Helix Versionhelix 23.05 (7f5940b) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
[[language]]
name = "hcl"
language-server = { command = 'terraform-ls', args = [ "serve" ], language-id = "terraform" }
[[language]]
name = "tfvars"
language-server = { command = 'terraform-ls', args = [ "serve" ], language-id = "terraform-vars" } see https://docs.helix-editor.com/languages.html#language-server-configuration You don't need to copy the whole |
Beta Was this translation helpful? Give feedback.
language-id
belongs in thelanguage-server
map:see https://docs.helix-editor.com/languages.html#language-server-configuration
You don't need to copy the whole
[[language]]
and[[grammar]]
blocks: the changes you add in~/.config/helix/languages.toml
are merged into the main language config from the repo.