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

Signature info gets incomprehensible in presence of extension methods, generics and tuples #33609

Closed
tmat opened this issue Feb 22, 2019 · 6 comments · Fixed by #56025
Closed
Labels
Area-IDE Feature Request IDE-IntelliSense Completion, Signature Help, Quick Info Need Design Review The end user experience design needs to be reviewed and approved.
Milestone

Comments

@tmat
Copy link
Member

tmat commented Feb 22, 2019

The displayed signature of SelectAsArray extension method is:

ImmutableArray<TResult> ImmutableArray<(DocumentId DocumentId, ImmutableArray<LineChange> Deltas)>.
SelectAsArray<(DocumentId DocumentId, ImmutableArray<LineChange> Deltas), TResult, TArg>(
Func<(DocumentId DocumentId, Immutable<ArrayChange> Deltas), TArg, TResult> map, TArg arg)

image

It's really hard to parse this when choosing between overloads of the method. We should think about better visualization of complex signatures.

The method itself is conceptually simple - it takes a lamda and applies it to elements of immutable array, but this is completely lost in the signature info. The problem is most apparent when tuples are substituted to generic parameters of Funcs.

@tmat
Copy link
Member Author

tmat commented Feb 22, 2019

One idea would be to calculate some metrics that determines complexity of signature with substituted generic parameters. If the metric is greater than some threshold introduce aliases for repeated types. Something like:

t ::= (DocumentId DocumentId, ImmutableArray<LineChange> Deltas)

ImmutableArray<TResult> ImmutableArray<t>.SelectAsArray<t, TResult, TArg>(Func<t, TArg, TResult> map, TArg arg)

@tmat tmat added the Area-IDE label Feb 22, 2019
@tmat
Copy link
Member Author

tmat commented Feb 22, 2019

@cartermp It seems that F# would have similar issue. Is there some technique you're using to simplify signature info for complex types?

@CyrusNajmabadi
Copy link
Member

We already do this for anonmous types. Seems like it might make sense to just expand this out to tuples int he same manner all the time. Maybe for the simplest tuples we wouldn't have to. But it seems like it would be generally necessary the moment you get any complexity.

@cartermp
Copy link
Contributor

@tmat we wrap docs, but we can also get some explody-looking tooltips as well 😢

We do extract the concrete type in tooltips:

image

But it's not 100% consistent:

image

So I'd say it needs "PM work", but as the first screenshot shows, the tooltip can still be rather large.

@DoctorKrolic
Copy link
Contributor

@CyrusNajmabadi You fixed this issue in #56025, so it should be closed now

@CyrusNajmabadi
Copy link
Member

SGTM! :)

@sharwell sharwell moved this to Need Proposal in IDE: Design review Aug 22, 2023
@CyrusNajmabadi CyrusNajmabadi moved this from Need Proposal to Complete in IDE: Design review Oct 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE Feature Request IDE-IntelliSense Completion, Signature Help, Quick Info Need Design Review The end user experience design needs to be reviewed and approved.
Projects
Status: Complete
Development

Successfully merging a pull request may close this issue.

6 participants