Skip to content

Contextual intellisense in Visual Studio #2151

@NoelAbrahams

Description

@NoelAbrahams

Hi,

The most obvious case is for enums:

enum Foo {
    bar,
    allBarOne
}

function f(foo: Foo) {

    foo === // list Foo members here
}

Should also work for boolean (although such comparisons are not very common).

Another case is for typeof in the context of union types:

function f(foo: string|number) {

    typeof foo === // 'string', 'number'
}

One problem with this case is that an option for single vs double quotes would need to be provided.

And also instanceof

class Foo {}

function f(foo: Foo|Array<number>) {

    foo instanceof // Foo, Array<number>
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Domain: APIRelates to the public API for TypeScriptHelp WantedYou can do thisSuggestionAn idea for TypeScript

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions