Skip to content

Auto import suggestions in TS 2.6 : wrong strategy for import paths #19694

@cyrilletuzi

Description

@cyrilletuzi

TypeScript Version: 2.7.0-dev.20171102
VSCode Version: Insiders, same date

Code

In an Angular project, start typing any Angular code, like :

@Inp

and select the auto-import suggestion.

Expected behavior:

Should import top level export :

import { Input } from '@angular/core';

Actual behavior:

Imports deep level export :

import { Input } from '@angular/core/src/metadata/directives';

It was handled fine when just one auto-import was suggested (see #19417).

Also, there was the same issue with the Import quick fix (#15223), but which was resolved a long time ago.

@mhegazy @mjbvz

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptDomain: Completion ListsThe issue relates to showing completion lists in an editorDomain: Quick FixesEditor-provided fixes, often called code actions.FixedA PR has been merged for this issueVS Code TrackedThere is a VS Code equivalent to this issue

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions