pappasam / jedi-language-server

A Python language server exclusively for Jedi. If Jedi supports it well, this language server should too.
MIT License
596 stars 45 forks source link

Make `textDocument/documentSymbol` ignore imported symbols #288

Open niqodea opened 11 months ago

niqodea commented 11 months ago

When requesting textDocument/documentSymbol, jedi-language-server always includes symbols in import statements. This is different from pyright, which instead ignores these symbols when providing the result, and python-lsp-server, which lets you select the behavior based on the pylsp.plugins.jedi_symbols.include_import_symbols option.

I think 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. Including import symbols bloats the top of the list with unnecessary information.

Would it be possible to include a flag in the same vein of python-lsp-server to only return symbols defined in the file?

Thank you!