diff --git a/neovim/lua/config/lsp.lua b/neovim/lua/config/lsp.lua index 7a4763d..882bdff 100644 --- a/neovim/lua/config/lsp.lua +++ b/neovim/lua/config/lsp.lua @@ -1,5 +1,7 @@ local ok, lspconfig = pcall(require, "lspconfig") +local log_directory = vim.env.LOG_HOME + if not ok then return end @@ -40,7 +42,7 @@ end -- Go lspconfig.gopls.setup{ on_attach = custom_attach, - cmd = {"gopls", "serve"}, + cmd = {"gopls", "serve", "-logfile="..log_directory.."/gopls.log"}, settings = { gopls = { analyses = { @@ -64,12 +66,13 @@ lspconfig.golangci_lint_ls.setup{} -- Jsonnet lspconfig.jsonnet_ls.setup{ on_attach = custom_attach, + cmd = {"jsonnet-language-server", "--lint"}, } -- Terraform lspconfig.terraformls.setup{ on_attach = custom_attach, - cmd = {"terraform-ls", "serve"}, + cmd = {"terraform-ls", "serve", "-log-file="..log_directory.."/terraformls.log"}, filetypes = {"terraform", "hcl", "tf"}, root_dir = lspconfig.util.root_pattern{".terraform", ".git", "main.tf"}, }