mirror of
https://github.com/neovim/nvim-lspconfig.git
synced 2026-05-05 08:36:09 +02:00
fix(angularls): add nil check for config parameter #4181
The cmd function's config parameter can sometimes be nil, causing a warning when attempting to access config.root. Added a nil check to safely handle this case. Fixes #4180
This commit is contained in:
parent
2010fc6ec0
commit
4e41e4c907
@ -66,7 +66,7 @@ end
|
||||
---@type vim.lsp.Config
|
||||
return {
|
||||
cmd = function(dispatchers, config)
|
||||
local root_dir = config.root or fn.getcwd()
|
||||
local root_dir = (config and config.root) or fn.getcwd()
|
||||
local node_paths = collect_node_modules(root_dir)
|
||||
|
||||
local ts_probe = table.concat(node_paths, ',')
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user