Add terraform lsp, fix eslint lsp

This commit is contained in:
Tyler Hallada 2023-12-01 15:26:02 -05:00
parent 9b1d5e0c96
commit 9a1c59026f

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,
})