-
Notifications
You must be signed in to change notification settings - Fork 771
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
Please improve pylance's parameter prompt layout style and provide function documentation #301
Comments
I had thought the original issue here would be fixed by the fixes for type aliases over-expanding, but it appears not: Even though this is defined as: def scatter(
x: ArrayLike,
y: ArrayLike,
s: Optional[Union[Scalar, ArrayLike]] = ...,
c: Optional[Union[_ColorLike, Sequence[float], Sequence[_ColorLike]]] = ...,
marker: Optional[MarkerStyle] = ...,
cmap: Optional[Colormap] = ...,
norm: Optional[Normalize] = ...,
vmin: Optional[Scalar] = ...,
vmax: Optional[Scalar] = ...,
alpha: Optional[Scalar] = ...,
linewidths: Optional[Union[Scalar, ArrayLike]] = ...,
verts: Optional[Any] = ..., # not documented?
edgecolors: Optional[Union[Literal["face", "none"], _ColorLike, Sequence[_ColorLike]]] = ...,
*,
plotnonfinite: bool = ...,
data: Optional[Any] = ...,
**kwargs: Any
) -> PathCollection: ... And should be displayed much smaller thanks to the aliases. |
Aliases are still expanded when used within unions because the resulting union needs to be deduped. I don't see any straightforward way to avoid this. Typescript also expands type aliases for unions. |
I can understand within a union (unfortunate), but ArrayLike is an alias itself and its name is being elided for the |
Yes, you're correct @jakebailey. There are places where the the type checker was transforming types unnecessarily and removing the type alias information in the process. I've checked in a fix, and the |
Okay, I've gotten it in. I won't mark this issue as closed quite yet (as I believe this is the overall tracking issue for "tooltips are too big"). |
☺Thanks for your reply! |
To be honest, the readability of parameter prompts is really poor. You can't even quickly distinguish which one is the formal parameter and which is the default parameter. You have to scan such a long function signature one by one, and there is no function document |
@jakebailey @erictraut Here's my suggestions, and it's up to you to accept or reject: We can show types in a non-monospaced font(say, Segoe UI) and/or in smaller sizes so that they will occupy less space, and in a different background color to make it easier to distinguish them and parameter names apart. |
Moving this issue to discussion as an enhancement request for comments and upvotes. |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Compared with jedi, pylance's parameter prompt typesetting is too dense and not suitable for reading. In addition, for the same function, pylance only has parameter prompts, but no function documentation.


The text was updated successfully, but these errors were encountered: