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 "Overload" hover into multiple lines, like completion #789

Closed
asukaminato0721 opened this issue Dec 29, 2020 · 4 comments
Closed

Split "Overload" hover into multiple lines, like completion #789

asukaminato0721 opened this issue Dec 29, 2020 · 4 comments
Labels
enhancement New feature or request

Comments

@asukaminato0721
Copy link

This is the typing hint of map

image

Maybe it's better to \n for each case?

(function) map: Overload[
(__func: (p0: _T1) -> _S, __iter1: Iterable[_T1]) -> Iterator[_S], 
(__func: (p0: _T1, p1: _T2) -> _S, __iter1: Iterable[_T1], __iter2: Iterable[_T2]) -> Iterator[_S],
(__func: (p0: _T1, p1: _T2, p2: _T3) -> _S, __iter1: Iterable[_T1], __iter2: Iterable[_T2], __iter3: Iterable[_T3]) -> Iterator[_S],
(__func: (p0: _T1, p1: _T2, p2: _T3, p3: _T4) -> _S, __iter1: Iterable[_T1], __iter2: Iterable[_T2], __iter3: Iterable[_T3], __iter4: Iterable[_T4]) -> Iterator[_S],
(__func: (p0: _T1, p1: _T2, p2: _T3, p3: _T4, p4: _T5) -> _S, __iter1: Iterable[_T1], __iter2: Iterable[_T2], __iter3: Iterable[_T3], __iter4: Iterable[_T4], __iter5: Iterable[_T5]) -> Iterator[_S],
(__func: (*args: Any, **kwargs: Any) -> _S, __iter1: Iterable[Any], __iter2: Iterable[Any], __iter3: Iterable[Any], __iter4: Iterable[Any], __iter5: Iterable[Any], __iter6: Iterable[Any], *iterables: Iterable[Any]) -> Iterator[_S]
]

Or it seems better to be:

(__func: (*args: Any, **kwargs: Any) -> _S,
__iter1: Iterable[Any],
__iter2: Iterable[Any],
__iter3: Iterable[Any],
__iter4: Iterable[Any],
__iter5: Iterable[Any],
__iter6: Iterable[Any],
*iterables: Iterable[Any]
) -> Iterator[_S]
@judej judej added the enhancement New feature or request label Jan 4, 2021
@github-actions github-actions bot removed the triage label Jan 4, 2021
@ain-soph
Copy link

Highly agree with it. It's painful to read a method with many kinds of overload.

@bschnurr
Copy link
Member

I think we can solve this by adding double space or double backslash to the end of each line to signify a line break in markdown.

@jakebailey
Copy link
Member

These blocks are code blocks, and I don't think you can do that in them. If an overload is at the top level of a printed type for a tooltip, then it'd be nice to split it up into multiple lines each their own signature (rather than the nesting).

@jakebailey jakebailey changed the title typing hint is kind of messy. Split "Overload" hover into multiple lines, like completion Feb 2, 2021
@jakebailey
Copy link
Member

This is actually a dupe of #612.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants