fix(terraform): disable semantic tokens to prevent editor hangs

Workaround for terraform-ls sending invalid semantic tokens that cause

Neovim 0.12 to freeze when opening terraform files with heredoc blocks.

See: https://github.com/hashicorp/terraform-ls/issues/2094
This commit is contained in:
MiguelNdeCarvalho 2026-03-30 17:55:27 +01:00
parent 96f4f18d7d
commit 981d9cb1ed
No known key found for this signature in database
GPG key ID: 0391C111C408C6F2

View file

@ -16,6 +16,16 @@ return {
servers = {
terraformls = {},
},
setup = {
terraformls = function(_, opts)
-- workaround for terraform-ls sending invalid semantic tokens
-- https://github.com/hashicorp/terraform-ls/issues/2094
Snacks.util.lsp.on({ name = "terraformls" }, function(_, client)
client.server_capabilities.semanticTokensProvider = nil
end)
-- end workaround
end,
},
},
},
-- ensure terraform tools are installed