diff options
| author | Ahmad bin Marakkar <109348574+Ask-786@users.noreply.github.com> | 2025-01-29 21:36:30 +0530 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-01-29 08:06:30 -0800 |
| commit | e6ea6328950194b22c43904315473019d066d51a (patch) | |
| tree | 67144dd54848a14c8d6c07b8df9c045a2a70aa0e /lua | |
| parent | fix(angularls): pass --angularCoreVersion for backwards compatibility #3592 (diff) | |
| download | nvim-lspconfig-e6ea6328950194b22c43904315473019d066d51a.tar nvim-lspconfig-e6ea6328950194b22c43904315473019d066d51a.tar.gz nvim-lspconfig-e6ea6328950194b22c43904315473019d066d51a.tar.bz2 nvim-lspconfig-e6ea6328950194b22c43904315473019d066d51a.tar.lz nvim-lspconfig-e6ea6328950194b22c43904315473019d066d51a.tar.xz nvim-lspconfig-e6ea6328950194b22c43904315473019d066d51a.tar.zst nvim-lspconfig-e6ea6328950194b22c43904315473019d066d51a.zip | |
fix(angularls): handle nil #3594
Problem:
Warning message while opening a directory without node_modules.
Solution:
Handle nil.
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/lspconfig/configs/angularls.lua | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lua/lspconfig/configs/angularls.lua b/lua/lspconfig/configs/angularls.lua index 45b756b4..06d3c24e 100644 --- a/lua/lspconfig/configs/angularls.lua +++ b/lua/lspconfig/configs/angularls.lua @@ -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 '' |
