You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
That means that we get up to this point in this function, thus we get the warning and then the error. Since, the function doesn't explicitly return anything after these 2 warnings happen, it should implicitly return nil, thus the error we get.
Returning an empty table between lines 182-183 return {} or changing this line to locations = utils.filter_symbols(locations, opts, symbols_sorter) or {} seems to solve the error.
Not familiar with Telescope codebase overall and fairly new to programming, so I'm not sure which the best implementation is and if what I proposed in the previous paragraph might result to some other side-effects, so I'll just leave it up to you how to best solve this situation.
telescope: health#telescope#check
Checking for required plugins ~
- OK plenary installed.
- OK nvim-treesitter installed.
Checking external dependencies ~
- OK rg: found ripgrep 14.1.1 (rev 4649aa9700)
- OK fd: found fd 10.2.0
===== Installed extensions ===== ~
Steps to reproduce
Run the minimal config with nvim -u minimal.lua and after you open a file (I opened minimal.lua myself) and did :lua require("telescope.builtin").lsp_document_symbols({symbols = {"Class"}}) and I got the error I described.
Description
When you do
:lua require("telescope.builtin").lsp_document_symbols({symbols = {"Class"}})
in a file that has no such symbols then you get errorThat means that we get up to this point in this function, thus we get the warning and then the error. Since, the function doesn't explicitly return anything after these 2 warnings happen, it should implicitly return
nil
, thus the error we get.Returning an empty table between lines 182-183
return {}
or changing this line tolocations = utils.filter_symbols(locations, opts, symbols_sorter) or {}
seems to solve the error.Not familiar with Telescope codebase overall and fairly new to programming, so I'm not sure which the best implementation is and if what I proposed in the previous paragraph might result to some other side-effects, so I'll just leave it up to you how to best solve this situation.
Neovim version
Operating system and version
Linux Mint 21.3
Telescope version / branch / rev
commit 2eca9ba
checkhealth telescope
Steps to reproduce
Run the minimal config with
nvim -u minimal.lua
and after you open a file (I openedminimal.lua
myself) and did:lua require("telescope.builtin").lsp_document_symbols({symbols = {"Class"}})
and I got the error I described.Expected behavior
Should not error.
Actual behavior
Errors with
Minimal config
The text was updated successfully, but these errors were encountered: