Skip to content

Prefer Top Level Export For Missing Import Quick Fix #16959

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mjbvz opened this issue Jul 5, 2017 · 1 comment
Closed

Prefer Top Level Export For Missing Import Quick Fix #16959

mjbvz opened this issue Jul 5, 2017 · 1 comment
Labels
Duplicate An existing issue was already created VS Code Tracked There is a VS Code equivalent to this issue

Comments

@mjbvz
Copy link
Contributor

mjbvz commented Jul 5, 2017

From microsoft/vscode#30001

TypeScript Version: 2.4.1

Steps
In a new workspace:

  1. npm install @angular/core. Angular core ships with its own d.ts files

  2. In a JS file:

@Component({}) 
class Foo{}
  1. Trigger Fix Missing import quick fix on Component

Expected behavior:
A quick fix that adds an @angular/core import is shown.

Actual behavior:
Quick fixes for importing from folders under @angular/core are shown

screen shot 2017-07-05 at 4 38 40 pm

In this case, it appears that the implicit javascript project is loading all d.ts files from @angular/core:

Open files: 
/Users/matb/projects/san/test.js
Info 97   Project '/dev/null/inferredProject1*' (Inferred) 0
/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/extensions/node_modules/typescript/lib/lib.es6.d.ts
/Users/matb/projects/san/test.js
/Users/matb/Library/Caches/typescript/2.4/node_modules/@types/reflect-metadata/index.d.ts
/Users/matb/projects/san/node_modules/@angular/core/src/di/injection_token.d.ts
/Users/matb/projects/san/node_modules/@angular/core/src/type.d.ts
/Users/matb/projects/san/node_modules/@angular/core/src/metadata/di.d.ts
/Users/matb/projects/san/node_modules/@angular/core/src/change_detection/constants.d.ts
/Users/matb/projects/san/node_modules/@angular/core/src/di/metadata.d.ts
/Users/matb/projects/san/node_modules/@angular/core/src/di/forward_ref.d.ts
...

Shouldn't this be limited to loading the d.ts from just the package.json typings and any files it references?

@mhegazy
Copy link
Contributor

mhegazy commented Aug 17, 2017

looks like a duplicate of #15223

@mhegazy mhegazy closed this as completed Aug 17, 2017
@mhegazy mhegazy added the Duplicate An existing issue was already created label Aug 17, 2017
@microsoft microsoft locked and limited conversation to collaborators Jun 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Duplicate An existing issue was already created VS Code Tracked There is a VS Code equivalent to this issue
Projects
None yet
Development

No branches or pull requests

2 participants