Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split (or hide) multiple overloads in tooltips for functions #612

Closed
christopherdwelton opened this issue Nov 16, 2020 · 7 comments
Closed
Labels
enhancement New feature or request fixed in next version (main) A fix has been implemented and will appear in an upcoming version

Comments

@christopherdwelton
Copy link

christopherdwelton commented Nov 16, 2020

Intellisense tooltips for autocomplete selection have a newline between each overload, which helps immensely with legibility. (It could even be argued a bit of extra space between the overloads wouldn't go amiss.)

autocomplete

Hovering over the same symbols after they are in the code, however, brings up a huge monolithic wall of text that is almost less useful than the old "Jedi" or "Microsoft" language server tooltips, just due to the shear amount of clutter.

overload

I believe this would look much better with newlines separating the overloads as is already the case in the autocomplete version.

@bejota
Copy link

bejota commented Nov 16, 2020

I agree this is unusable. I prefer the original code doc.

@judej judej added the enhancement New feature or request label Nov 16, 2020
@github-actions github-actions bot removed the triage label Nov 16, 2020
@jakebailey
Copy link
Member

They should definitely match (but we know that these tooltips can get unwieldy due to overloads / large signatures in general).

@taldcroft
Copy link

Adding to this, many of the code docs have become unusable in Pylance to the point where I'm switching back to Jedi for the time being despite many great features of Pylance.

Jedi (gives information I need)

image

Pylance (not useful for me)

I am also unable to scroll within that tooltip window to get to the actual docstring.

image

@timqsh
Copy link

timqsh commented Dec 20, 2020

I'm having the same issue. Docstrings for functions in itertools module and builtins like map and zip are lost when I switch language server to Pylance.

@jakebailey jakebailey changed the title Hover tooltips for builtins become walls of text. Split (or hide) multiple overloads in tooltips for functions Feb 5, 2021
@jakebailey
Copy link
Member

The next release splits the big Overload line into individual lines, matching the completion tooltip. Also, in cases where the tooltip is long (wider than VS Code's default width for each tooltip), an extra newline will be added to help distinguish it.

This is an incremental improvement; we may consider more significant changes like hiding all but the currently-matching overload on hover or completion (similar to TS and C#), but that will require a bit more consideration.

@jakebailey
Copy link
Member

The case in #612 (comment) is unrelated; that's more about docstring mapping, where itertools is actually compiled code within the python interpreter itself where we can't access it, so will be handled in the same way as #465 (which I'll retitle to be broader).

@jakebailey jakebailey added the fixed in next version (main) A fix has been implemented and will appear in an upcoming version label Mar 10, 2021
@jakebailey
Copy link
Member

This issue has been fixed in version 2021.3.1, which we've just released. You can find the changelog here: https://github.com/microsoft/pylance-release/blob/main/CHANGELOG.md#202131-10-march-2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request fixed in next version (main) A fix has been implemented and will appear in an upcoming version
Projects
None yet
Development

No branches or pull requests

6 participants