Browse Source

fix(langs.terraform): Added `terraform_fmt` null-ls formatter.

my-config
connorgmeean 2 years ago
parent
commit
4a4ea9321e
  1. 18
      lua/doom/modules/langs/terraform/init.lua
  2. 1
      modules.lua

18
lua/doom/modules/langs/terraform/init.lua

@ -1,17 +1,27 @@
local terraform = {}
terraform.settings = {}
terraform.settings = {
language_server_name = "terraformls",
}
terraform.autocmds = {
{
"FileType",
"terraform",
"BufWinEnter",
"*.hcl,*.tf,*.tfvars,*.nomad",
function()
local langs_utils = require("doom.modules.langs.utils")
langs_utils.use_lsp("terraformls")
langs_utils.use_lsp(doom.langs.terraform.settings.language_server_name)
local ts_install = require("nvim-treesitter.install")
ts_install.ensure_installed("hcl")
--
-- Setup null-ls
if doom.features.linter then
local null_ls = require("null-ls")
langs_utils.use_null_ls_source({
null_ls.builtins.formatting.terraform_fmt,
})
end
end,
once = true,
},

1
modules.lua

@ -80,6 +80,7 @@ return {
-- "config", -- JSON, YAML, TOML
-- "markdown",
-- "terraform", -- Terraform / hcl files support
}
}

Loading…
Cancel
Save