[lsp] Add functionality to add root_pattern in lsp configs
This commit is contained in:
@@ -290,7 +290,14 @@ function P.setup_server(name)
|
|||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- server.lspconfig.root_dir = function () return vim.fn.getcwd() end
|
||||||
|
if server.root_pattern then
|
||||||
|
server.lspconfig.root_dir = lspconfig.util.root_pattern(
|
||||||
|
unpack(server.root_pattern)
|
||||||
|
)
|
||||||
|
else
|
||||||
server.lspconfig.root_dir = lspconfig.util.find_git_ancestor
|
server.lspconfig.root_dir = lspconfig.util.find_git_ancestor
|
||||||
|
end
|
||||||
server.lspconfig.capabilities = P.capabilities
|
server.lspconfig.capabilities = P.capabilities
|
||||||
server.lspconfig.on_attach = function (...)
|
server.lspconfig.on_attach = function (...)
|
||||||
local resp
|
local resp
|
||||||
|
|||||||
Reference in New Issue
Block a user