Skip to content

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

Closed

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.

Activity

  1. DanielRosenwasser commented on Dec 27, 2016

    @DanielRosenwasser
    Member

    Looks like a regression of #6124.

  2. ghost added
    FixedA PR has been merged for this issue
    on Jul 11, 2017
  3. ghost closed this as completedon Jul 11, 2017
  4. locked and limited conversation to collaborators on Jun 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptDomain: LS: 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