mirror of
https://github.com/LunarVim/LunarVim.git
synced 2025-08-29 06:18:18 +02:00
[feature] Move common parts of language server setup to lsp/init (#1355)
* moving common parts of language server setup to lsp/init * fix formatting
This commit is contained in:
parent
85fe093efb
commit
2bcbed1499
2 changed files with 13 additions and 152 deletions
|
@ -138,6 +138,17 @@ function M.setup(lang)
|
|||
|
||||
if lsp.provider ~= nil and lsp.provider ~= "" then
|
||||
local lspconfig = require "lspconfig"
|
||||
|
||||
if not lsp.setup.on_attach then
|
||||
lsp.setup.on_attach = M.common_on_attach
|
||||
end
|
||||
if not lsp.setup.on_init then
|
||||
lsp.setup.on_init = M.common_on_init
|
||||
end
|
||||
if not lsp.setup.capabilities then
|
||||
lsp.setup.capabilities = M.common_capabilities()
|
||||
end
|
||||
|
||||
lspconfig[lsp.provider].setup(lsp.setup)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue