Closed niqodea closed 11 months ago
Checked in the source code and it seems like there is already an option to do this! It's called
pylsp.plugins.jedi_symbols.include_import_symbols
and it defaults to True
.
Glad you found the solution by yourself!
When requesting
textDocument/documentSymbol
, pylsp includes symbols in import statements. This is, from what I could observe, different from pyright, which instead ignores these symbols when providing the result.I don't know if there is any specific reason for this. However, I argue that pyright's behavior is more useful when it comes to the use case of simply visualizing symbols in neovim's quickfix list or in aerial.nvim.
Would it be possible to change the behavior and only return symbols defined in the file?