Skip to content
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

Issue with importing from wrong place #15

Closed
stevewarsa opened this issue Sep 23, 2016 · 6 comments
Closed

Issue with importing from wrong place #15

stevewarsa opened this issue Sep 23, 2016 · 6 comments

Comments

@stevewarsa
Copy link

If I type Http and highlight and invoke (keybinding ctrl+i), it imports:

import {Http} from '@angular/http/src/http';

But should be:

import {Http} from '@angular/http';

@Sammons
Copy link
Owner

Sammons commented Sep 23, 2016

I'll take a look - thanks for reporting in. If you can, please link to some code I can use to reproduce.

@stevewarsa
Copy link
Author

well, I don't have any code, but here is how you can reproduce it:

using node 6.6.0

install angular-cli

My current version as I run this is 1.0.0-beta.14.

Then create a new project:

ng new myproject

cd myproject/src/app/shared

ng g s system --flat

open system.service.ts (myproject/src/app/shared) in VS Code

in the constructor, in between the parens, type

http:Http

Http will have a red line under it

Highlight Http and invoke your plugin to generate the import statement

You should see the problem then.

Thanks,
Steve

@Sammons
Copy link
Owner

Sammons commented Sep 23, 2016

I should also mention, I still use this plugin for my own convenience but others are gaining popularity over this one. This one just uses text manipulation and heuristics to get the job done, where others are more formally correct, there's a (closed) thread where some are discussed here - microsoft/TypeScript#188 (comment).

I just know that when I wrote this originally there weren't really other solutions, so I thought I'd share that.

I'll fix this as soon as I'm able to, but it will still be a few days because of regular work keeping me busy.

@Sammons
Copy link
Owner

Sammons commented Oct 11, 2016

@stevewarsa following your steps when I ran the plugin and got

import {Http} from '@angular/http/src/http';

what import did it find for you?

@Sammons
Copy link
Owner

Sammons commented Oct 14, 2016

@stevewarsa realizing what I said is exactly what you said the problem was (facepalm).

I know what the problem is.

@Sammons
Copy link
Owner

Sammons commented Dec 8, 2016

@stevewarsa I am stopping development on this project in leu of https://marketplace.visualstudio.com/items?itemName=rbbit.typescript-hero which has much more focused development behind it. I will continue to monitor this repo for new issues, but it doesn't make good sense to keep building when there is a technically superior solution available.

@Sammons Sammons closed this as completed Dec 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants