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

[typescript] Offer IntelliSense suggestions based on method parameter or local type #19855

Closed
mjbvz opened this issue Nov 9, 2017 · 2 comments
Labels
Suggestion An idea for TypeScript VS Code Tracked There is a VS Code equivalent to this issue

Comments

@mjbvz
Copy link
Contributor

mjbvz commented Nov 9, 2017

From @rstarkov on November 7, 2017 12:25

It would be useful if IntelliSense offered suggestions based on the expected type of the expression being edited. Consider the following examples:

function Foo(thing: Namespace.Stuff.SomeClass) { ... }

Foo(new |
        ^ here

let x: Namespace.Stuff.SomeClass;
x = new |
        ^ here

In these cases, "Namespace.Stuff.SomeClass" should be offered by IntelliSense at the indicated positions.

This behaviour would also be handy for enums: the enum type could be offered in the same contexts as above (without the new keyword obviously).

For enums there's another scenario where this would be handy, namely when I'm comparing an enum-typed local or parameter - IntelliSense should offer the enum type for autocompletion after I type the comparison operator.

Copied from original issue: microsoft/vscode#37771

@mjbvz mjbvz self-assigned this Nov 9, 2017
@mjbvz mjbvz added VS Code Tracked There is a VS Code equivalent to this issue and removed javascript labels Nov 9, 2017
@mjbvz mjbvz removed their assignment Nov 9, 2017
@mjbvz
Copy link
Contributor Author

mjbvz commented Nov 9, 2017

Moved over to TypeScript for further discussion

@mhegazy
Copy link
Contributor

mhegazy commented Nov 9, 2017

Made a related comment a few days ago in #16864 (review)

@mhegazy mhegazy added the Suggestion An idea for TypeScript label Nov 9, 2017
@mhegazy mhegazy assigned ghost Nov 9, 2017
@mhegazy mhegazy added this to the TypeScript 2.7 milestone Nov 9, 2017
@ghost ghost closed this as completed in #20020 Dec 1, 2017
@microsoft microsoft locked and limited conversation to collaborators Jun 14, 2018
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Suggestion An idea for TypeScript VS Code Tracked There is a VS Code equivalent to this issue
Projects
None yet
Development

No branches or pull requests

2 participants