Skip to content

Add Missing Import Quick Fix Should Be able to use File/Module Name for Default Exports #14663

Closed

Description

@mjbvz

From microsoft/vscode#21764 (comment)

TypeScript Version: 2.2.1

Example one in a project with the absolute module installed, write:

absolute('/dir/file');

There is no quick fix for adding a import like: import absolute from 'absolute'


Example Two:

In a project that uses default exports:

// abc.ts
export default 'abc'
// other.ts
console.log(abc);

No quick fix is generate for importing abc from abc.ts. If the default exported symbol has a name, such as when using a class or function, then we can import it.

Activity

  1. added
    VS Code Tracked
    on Mar 14, 2017
  2. mhegazy commented on Aug 17, 2017

    @mhegazy
    Contributor

    We really need to put the symbol in the completion list first.

  3. added
    Domain: LS: Completion Lists
    Domain: LS: Quick Fixes
    Bug
    on Aug 17, 2017
  4. added
    Suggestion
    and removed
    Bug
    on Aug 21, 2017
  5. mjbvz commented on Nov 9, 2017

    @mjbvz
    ContributorAuthor

    Was this fixed by #19875?

  6. amcasey commented on Nov 9, 2017

    @amcasey
    Member
  7. ghost closed this as completedon Nov 10, 2017
  8. ghost added
    Fixed
    on Nov 10, 2017
  9. 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

Labels

Domain: LS: Completion ListsDomain: LS: Quick FixesFixedSuggestionVS Code Tracked

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions