Skip to content

Improve completions at x < (type arguments or less than) #23631

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

Closed
ghost opened this issue Apr 23, 2018 · 3 comments
Closed

Improve completions at x < (type arguments or less than) #23631

ghost opened this issue Apr 23, 2018 · 3 comments
Labels
Domain: Signature Help Information in editor tooltips when invoking a function call Fixed A PR has been merged for this issue Suggestion An idea for TypeScript

Comments

@ghost
Copy link

ghost commented Apr 23, 2018

TypeScript Version: master

Code

x < /**/

Expected behavior:

If x is a number or string, get completions for values.
If x is a function, get completions for types.

Actual behavior:

Get completions for both.

@ghost ghost added Suggestion An idea for TypeScript Domain: Completion Lists The issue relates to showing completion lists in an editor labels Apr 23, 2018
@mhegazy
Copy link
Contributor

mhegazy commented Apr 23, 2018

I think this is more of signature help. we used to have this in TS 1.0, but never rewrote the feature. the idea is it treats < like ( in a function call, and shows you the list of applicable type parameters. see commented out section inhttps://github.com/Microsoft/TypeScript/commit/102da2d80a83d340a8bbcdea3814c7f1b87dd944#diff-77414312b9c8809bd4ba9e31e0c5f940R8 for more context.

@mhegazy mhegazy added Domain: Signature Help Information in editor tooltips when invoking a function call and removed Domain: Completion Lists The issue relates to showing completion lists in an editor labels Apr 23, 2018
@ghost
Copy link
Author

ghost commented May 1, 2018

As noted by @sheetalkamat in #23632 (comment) there is a function isPossiblyTypeArgumentPosition that should be able to handle this.

@mhegazy mhegazy added this to the TypeScript 3.0 milestone May 1, 2018
@mhegazy mhegazy assigned ghost May 1, 2018
@ghost ghost added the Fixed A PR has been merged for this issue label Jun 18, 2018
@ghost
Copy link
Author

ghost commented Jun 18, 2018

Signature help part done in #24138

@mhegazy mhegazy closed this as completed Jun 19, 2018
ghost pushed a commit that referenced this issue Aug 27, 2018
ghost pushed a commit that referenced this issue Aug 27, 2018
ghost pushed a commit that referenced this issue Aug 27, 2018
ghost pushed a commit that referenced this issue Aug 27, 2018
ghost pushed a commit that referenced this issue Aug 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Domain: Signature Help Information in editor tooltips when invoking a function call Fixed A PR has been merged for this issue Suggestion An idea for TypeScript
Projects
None yet
Development

No branches or pull requests

1 participant