-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Description
TypeScript Version: 2.6.0-dev.20171019 and 2.7.0-dev.20171021
Tested in VS Code Insiders.
Following #7849 and microsoft/vscode#2635
Code
Install an Angular project :
npm install @angular/cli -g
ng new autoimport
Then in src/app/app.component.ts, add a new property and instantiate it with EventEmitter, using the new auto-import on completion :
export class AppComponent {
title = 'app';
test = new EventEmi // ...then choose from the completion list
}Expected behavior:
Should be able to select the good class between the multiple ones available to have the good import :
import { Component, EventEmitter } from '@angular/core';Actual behavior:
Problem is : several librairies export a class EventEmitter with the same name.
Currently, completion suggestions seem to be deduped, so just one is proposed, resulting in the wrong auto import :
import { EventEmitter } from 'events';By the way, in case of multiple tokens with the same name, the completion list should display an information about the packages concerned, to be able to choose the good one.