From c8a336773d6efad1f61d0555025b259dcf1a7967 Mon Sep 17 00:00:00 2001 From: Dan Anglin Date: Wed, 18 May 2022 07:51:50 +0100 Subject: [PATCH] fix: configure logging for the LSPs. --- neovim/lua/config/lsp.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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"}, }