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:
Furkan Aydin 2025-11-12 07:35:26 +03:00 committed by GitHub
parent 2010fc6ec0
commit 4e41e4c907
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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, ',')