Add terraform lsp, fix eslint lsp

This commit is contained in:
Tyler Hallada 2023-11-10 14:29:33 -05:00
parent 2d7a465268
commit 7ec0fd9f43

View File

@ -34,7 +34,7 @@ require('lspconfig')['jsonls'].setup({
require('lspconfig')['eslint'].setup({ require('lspconfig')['eslint'].setup({
on_attach = on_attach, on_attach = on_attach,
flags = lsp_flags, flags = lsp_flags,
root_dir = require('lspconfig').util.find_git_ancestor, -- root_dir = require('lspconfig').util.find_git_ancestor,
}) })
require('lspconfig')['html'].setup({ require('lspconfig')['html'].setup({
on_attach = on_attach, on_attach = on_attach,
@ -99,3 +99,13 @@ require('lspconfig')['zls'].setup({
on_attach = on_attach, on_attach = on_attach,
flags = lsp_flags, flags = lsp_flags,
}) })
require('lspconfig')['terraformls'].setup({
on_attach = on_attach,
flags = lsp_flags,
})
vim.api.nvim_create_autocmd({"BufWritePre"}, {
pattern = {"*.tf", "*.tfvars"},
callback = function()
vim.lsp.buf.format()
end,
})