Skip to content

Completion list for module with default export should use "default", not the function's name #12957

Closed
@ghost

Description

TypeScript Version: nightly (2.2.0-dev.20161215)

Code

/// <reference path="fourslash.ts" />

// @Filename: a.ts
////export function x() {}
////export default function y() {}

// @Filename: b.ts
////import * as a from "./a";
////a./**/;

goTo.marker();
verify.completionListContains("x", "function x(): void");
verify.completionListContains("default", "function y(): void");

Expected behavior:

Test succeeds.

Actual behavior:

Error: Marker: 
Expected "{
  "name": "default",
  "text": "function b(): void"
}" to be in list [{
  "name": "x",
  "kind": "function"
},
{
  "name": "y",
  "kind": "function"
}]

Problem: a.y() won't compile, a.default() will. So we should use default for the completion, not y.

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

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions