Skip to content

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

@rstarkov

Description

@rstarkov

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.

Metadata

Metadata

Assignees

Labels

javascriptJavaScript support issuesupstreamIssue identified as 'upstream' component related (exists outside of VS Code)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions