microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
162.65k stars 28.68k forks source link

angular4 autoimport problem #32120

Closed GilHyeon closed 7 years ago

GilHyeon commented 7 years ago

I wrote code Angular4 with vscode. some module auto import is wrong.

for example, Routes, RouterModule auto import like this

import { Routes, RouterModule } from "@angular/router/router";

but it's not correct. this is correct import statement

import { Routes, RouterModule } from "@angular/router";

this problem have also 'angular/forms' modules import

// wrong import
import { FormGroup } from "@angular/forms/forms";

// correct import 
import { FormGroup } from "@angular/forms";

Steps to Reproduce:

  1. wrote Routes and click yellow lamb.
  2. select import but there is no correct import statement
    • this step has 3 recommend statements
      import { Routes } from "@angular/router/src";
      import { Routes } from "@angular/router/public_api";
      import { Routes } from "@angular/router/router";
  3. I select third statement. but it occurred build error.
  4. I changed statement correctly
    import { Routes } from "@angular/router
  5. next, RouterModule add auto import is done correctly like this
    import { Routes, RouterModule } from "@angular/router";

Reproduces without extensions: Yes

mjbvz commented 7 years ago

This issue was moved to Microsoft/TypeScript#17705