Skip to content

Incorrect completion offered for export default of named function/class #16706

Closed
@Jessidhia

Description

@Jessidhia

TypeScript Version: 2.5.0-dev.20170622

Code

// a.ts
export default function foo () {}

// b.ts
import * as a from './a'

a./* request completion */

Expected behavior:
default to be offered as the completion options.

Actual behavior:
foo is offered as the completion option.

image

Fortunately, the type checker correctly expects default as the key. Calling a.default() will work, but a.foo() (as suggested by the completions) will error with "Property 'foo' does not exist on type".

Also possibly related is that import { /* request completion */ } from './a' does not list default as an option (it should), but it at least does not list foo.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptDomain: Completion ListsThe issue relates to showing completion lists in an editorFixedA PR has been merged for this issue

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions