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 ok, lspconfig = pcall(require, "lspconfig")
|
||||||
|
|
||||||
|
local log_directory = vim.env.LOG_HOME
|
||||||
|
|
||||||
if not ok then
|
if not ok then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
@ -40,7 +42,7 @@ end
|
||||||
-- Go
|
-- Go
|
||||||
lspconfig.gopls.setup{
|
lspconfig.gopls.setup{
|
||||||
on_attach = custom_attach,
|
on_attach = custom_attach,
|
||||||
cmd = {"gopls", "serve"},
|
cmd = {"gopls", "serve", "-logfile="..log_directory.."/gopls.log"},
|
||||||
settings = {
|
settings = {
|
||||||
gopls = {
|
gopls = {
|
||||||
analyses = {
|
analyses = {
|
||||||
|
@ -64,12 +66,13 @@ lspconfig.golangci_lint_ls.setup{}
|
||||||
-- Jsonnet
|
-- Jsonnet
|
||||||
lspconfig.jsonnet_ls.setup{
|
lspconfig.jsonnet_ls.setup{
|
||||||
on_attach = custom_attach,
|
on_attach = custom_attach,
|
||||||
|
cmd = {"jsonnet-language-server", "--lint"},
|
||||||
}
|
}
|
||||||
|
|
||||||
-- Terraform
|
-- Terraform
|
||||||
lspconfig.terraformls.setup{
|
lspconfig.terraformls.setup{
|
||||||
on_attach = custom_attach,
|
on_attach = custom_attach,
|
||||||
cmd = {"terraform-ls", "serve"},
|
cmd = {"terraform-ls", "serve", "-log-file="..log_directory.."/terraformls.log"},
|
||||||
filetypes = {"terraform", "hcl", "tf"},
|
filetypes = {"terraform", "hcl", "tf"},
|
||||||
root_dir = lspconfig.util.root_pattern{".terraform", ".git", "main.tf"},
|
root_dir = lspconfig.util.root_pattern{".terraform", ".git", "main.tf"},
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue