fix: configure logging for the LSPs.
This commit is contained in:
parent
5c1fb279d2
commit
c8a336773d
1 changed files with 5 additions and 2 deletions
|
@ -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"},
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue