Skip to content

Commit

Permalink
fix(angularls): handle nil #3594
Browse files Browse the repository at this point in the history
Problem:
Warning message while opening a directory without node_modules.

Solution:
Handle nil.
  • Loading branch information
Ask-786 authored Jan 29, 2025
1 parent 9962e25 commit e6ea632
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lua/lspconfig/configs/angularls.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ end
local function get_angular_core_version(root_dir)
local project_root = vim.fs.dirname(vim.fs.find('node_modules', { path = root_dir, upward = true })[1])

if not project_root then
return ''
end

local package_json = project_root .. '/package.json'
if not vim.loop.fs_stat(package_json) then
return ''
Expand Down

0 comments on commit e6ea632

Please sign in to comment.