pappasam / jedi-language-server

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

Reduce amount of information shown in hovers #227

Closed alexdima closed 1 year ago

alexdima commented 1 year ago

👋 Hi, coming here from https://github.com/microsoft/vscode/issues/159247

It looks like the hovers returned by jedi are sometimes super verbose and detailed. VS Code users are now asking us to better handle very large hovers. The problem is that on our side, we can truncate the markdown after some amount of characters, but that would give IMHO also a bad user experience.

Would it please be possible to be more succint in the hovers (e.g. the language specification part might be omitted or shown only after enabling a setting).

pappasam commented 1 year ago

@alexdima this has been implemented for a while, the vscode team just hasn't used the existing feature. Please refer to the hover section in https://github.com/pappasam/jedi-language-server#configuration . Keyword hover can be disabled there. See https://github.com/pappasam/jedi-language-server/pull/149 for when / how this feature was implemented

luabud commented 1 year ago

Oh cool, thanks a lot for the info! I opened https://github.com/microsoft/vscode-python/pull/19926 to fix it in the Python extension side.

r3m0t commented 1 year ago

@pappasam could keyword hover be off by default? Advanced Python users know their keywords, beginner Python users won't understand these hovers.

pappasam commented 1 year ago

@r3m0t it can be, and this is certainly something an individual language client (eg, vscode-client) can configure as its default. Hence the initialization option we already provide; individual language clients are free to use that however they want. That said, for simplicity's sake in this codebase, I don't want to default it to off on the server side.

alexdima commented 1 year ago

Thank you very much for pointing us in the right direction! I'll close this out since the setting already exists.