[lsp] Add functionality to add root_pattern in lsp configs

This commit is contained in:
2023-12-23 01:52:41 +01:00
parent 34cff266a1
commit ebb69cf87c
+7
View File
@@ -290,7 +290,14 @@ function P.setup_server(name)
return
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
end
server.lspconfig.capabilities = P.capabilities
server.lspconfig.on_attach = function (...)
local resp