From 1d75785bf20a78ecbcc5707402bdeb467b643880 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Schr=C3=B6ter?= <dev@felschr.com> Date: Sun, 18 May 2025 15:22:25 +0200 Subject: [PATCH] feat(editors): add opentofu-ls --- home/editors/helix/default.nix | 23 +++++++++++++++++++++++ home/editors/lsp.nix | 1 + 2 files changed, 24 insertions(+) diff --git a/home/editors/helix/default.nix b/home/editors/helix/default.nix index 68ca97a..ffb18dc 100644 --- a/home/editors/helix/default.nix +++ b/home/editors/helix/default.nix @@ -80,6 +80,22 @@ in "buf-lint" ]; } + { + name = "hcl"; + language-id = "opentofu"; + language-servers = [ "opentofu-ls" ]; + injection-regex = "(hcl|tf|tofu)"; + file-types = [ + "hcl" + "tf" + "tofu" + ]; + } + { + name = "tfvars"; + language-id = "opentofu-vars"; + language-servers = [ "opentofu-ls" ]; + } { name = "graphql"; formatter = prettier "graphql"; @@ -211,6 +227,13 @@ in }; }; }; + opentofu-ls = { + command = "opentofu-ls"; + args = [ "serve" ]; + config = { + opentofu.path = "tofu"; + }; + }; }; settings = { theme = "dark_plus"; diff --git a/home/editors/lsp.nix b/home/editors/lsp.nix index 541afb3..5b7781e 100644 --- a/home/editors/lsp.nix +++ b/home/editors/lsp.nix @@ -8,6 +8,7 @@ unstable.nixd nls terraform-ls + unstable.opentofu-ls pyright nodePackages.bash-language-server nodePackages.vim-language-server