Extract root_dir from server's settings table

This commit is contained in:
Guillaume Comte 2022-12-30 10:30:58 +01:00 committed by GitHub
parent c4d7212de3
commit 3f41f32d92
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -370,10 +370,14 @@ mason_lspconfig.setup {
mason_lspconfig.setup_handlers { mason_lspconfig.setup_handlers {
function(server_name) function(server_name)
-- In case root_dir is set in the servers table, we need to extract it before calling setup
local root_dir = servers[server_name]['root_dir']
servers[server_name]['root_dir'] = nil
require('lspconfig')[server_name].setup { require('lspconfig')[server_name].setup {
capabilities = capabilities, capabilities = capabilities,
on_attach = on_attach, on_attach = on_attach,
settings = servers[server_name], settings = servers[server_name],
root_dir = root_dir,
} }
end, end,
} }