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

Support Signature Help/Parameter Hints for Type Arguments #2834

Closed
HerrNiklasRaab opened this issue Sep 30, 2020 · 3 comments
Closed

Support Signature Help/Parameter Hints for Type Arguments #2834

HerrNiklasRaab opened this issue Sep 30, 2020 · 3 comments
Labels
in editor Relates to code editing or language features in lsp/analysis server Something to be fixed in the Dart analysis server is enhancement
Milestone

Comments

@HerrNiklasRaab
Copy link

Is your feature request related to a problem? Please describe.
I'm always frustrated when, I am filling type parameters of a class or a method because I don't know which type parameters I need to fill, how many there are, what the do usw.

I then need to move to my mouse, hover over the method or class to get that information. In the moment I have moved to the keyboard again, I again have forgotten the type arguments.

Describe the solution you'd like
When I am typing the "," after the double in the screenshot, it would be nice when a popup would appear, with the signature of the method, but more importantly the name and the type constraint of the type parameter. With multiple type parameters the, current type argument should be highlighted (bold font) in the pop-up. So for example when I am typing Class<Abc, def, in the popup it should appear like "Class<Type1, Type2 extends Type3>".
image

I know, this is probably difficult to implement and would need support in VSCode and in Server, but it's hard for me to evaluate that.

@HerrNiklasRaab
Copy link
Author

Even more frustrating is the following situation:
image

Because of the error the I can't see any type paramters.

@DanTup DanTup added in editor Relates to code editing or language features in lsp/analysis server Something to be fixed in the Dart analysis server labels Sep 30, 2020
@DanTup DanTup added this to the On Deck milestone Sep 30, 2020
@DanTup
Copy link
Member

DanTup commented Sep 30, 2020

I like this idea - we may be able to use the same "signature help" we use for standard arguments for type arguments.

Because of the error the I can't see any type paramters.

I'm not sure there's much we can do about that from the extension (VS Code controls when to show hovers etc.), but pressing <escape> will hide any active popup - that's about the best I have for that for now! :-)

@DanTup DanTup modified the milestones: On Deck, v3.24.0 May 24, 2021
@DanTup DanTup changed the title Typeargument Autocomplete Support Signature Help/Parameter Hints for Type Arguments Jun 22, 2021
@DanTup
Copy link
Member

DanTup commented Jun 22, 2021

With https://dart-review.googlesource.com/c/sdk/+/204404, it will be possible to invoke Signature Help / Parameter Hints inside type arguments to get some signature help:

Screenshot 2021-06-22 at 10 32 53

It would be nice to auto-trigger on the <, but that currently seems nontrivial (at the point only < is typed, it seems ambiguous whether it's an argument list) so is not currently supported. For a similar reason, you need to have both <> typed for this to work even when manually invoking. These may be improved in future, but for now I think there's still great value in being able to invoke manually.

dart-bot pushed a commit to dart-lang/sdk that referenced this issue Jun 22, 2021
See Dart-Code/Dart-Code#2834.

Change-Id: Idce0d0b133b1f40c1953e5f1c5f4531701a68c56
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/204404
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Brian Wilkerson <brianwilkerson@google.com>
@DanTup DanTup closed this as completed Jun 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in editor Relates to code editing or language features in lsp/analysis server Something to be fixed in the Dart analysis server is enhancement
Projects
None yet
Development

No branches or pull requests

2 participants