mirror of
https://github.com/LazyVim/LazyVim.git
synced 2026-07-22 20:41:08 +00:00
feat(lang): add opentofu support
This commit is contained in:
parent
c64a61734f
commit
fa05865a31
1 changed files with 57 additions and 0 deletions
57
lua/lazyvim/plugins/extras/lang/opentofu.lua
Normal file
57
lua/lazyvim/plugins/extras/lang/opentofu.lua
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
vim.filetype.add({
|
||||
extension = {
|
||||
tofu = "opentofu",
|
||||
},
|
||||
})
|
||||
|
||||
return {
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
opts = function(_, opts)
|
||||
opts.ensure_installed = opts.ensure_installed or {}
|
||||
vim.list_extend(opts.ensure_installed, { "terraform", "hcl" })
|
||||
vim.treesitter.language.register("opentofu", "hcl")
|
||||
end,
|
||||
},
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
opts = {
|
||||
servers = {
|
||||
tofu_ls = {},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"mason-org/mason.nvim",
|
||||
opts = { ensure_installed = { "tofu-ls" } },
|
||||
},
|
||||
{
|
||||
"nvimtools/none-ls.nvim",
|
||||
optional = true,
|
||||
opts = function(_, opts)
|
||||
local null_ls = require("null-ls")
|
||||
opts.sources = vim.list_extend(opts.sources or {}, {
|
||||
null_ls.builtins.formatting.opentofu_fmt,
|
||||
null_ls.builtins.diagnostics.opentofu_validate,
|
||||
})
|
||||
end,
|
||||
},
|
||||
{
|
||||
"mfussenegger/nvim-lint",
|
||||
optional = true,
|
||||
opts = {
|
||||
linters_by_ft = {
|
||||
opentofu = { "tofu" },
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"stevearc/conform.nvim",
|
||||
optional = true,
|
||||
opts = {
|
||||
formatters_by_ft = {
|
||||
opentofu = { "tofu_fmt" },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue