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

Please add feature to fix imports #49

Closed
Chris2011 opened this issue Apr 11, 2016 · 5 comments
Closed

Please add feature to fix imports #49

Chris2011 opened this issue Apr 11, 2016 · 5 comments
Labels

Comments

@Chris2011
Copy link

In Java you have a feature when you have this:

class Test extends BaseTest implements ITest {
}

if you haven't import the right package for BaseTest or ITest yet, you can hit Alt + Enter and you got the hint functionality "Add package: org.foo.bar.BaseTest."

This feature would be very handy for TypeScript too, that he can find any module where ITest and BaseTest is declared or exported and show the hint which import you want to use.

Cheers

Chris

@Chris2011
Copy link
Author

As you can see it here: http://blog.jetbrains.com/webstorm/2016/04/angular-2-workflow-in-webstorm/#ng2-imports

this is exact what I would like to see in this plugin. Imports are resolved while adding the @component code snippet to the source code. And for other Components like self written or so, it would be great to see the error: "Can't find module myModule" and when I hit alt + enter I got the hints where I can say: "Add Import Comp.myModule" or smth like that. Fix imports is in Java working as well.

@everflux
Copy link

That would be a great help indeed.

@jeffrey-easyesi
Copy link
Contributor

"Quick fix" functionality like this is something that belongs in the TypeScript language service, so that all plugins based on that could use it.

See: microsoft/TypeScript#6943

@jeffrey-easyesi
Copy link
Contributor

This has been implemented in the TypeScript project and will be in version 2.2: microsoft/TypeScript#11768

@Chris2011
Copy link
Author

Works super. Not perfect but for this little misbehaviour I will create a new ticket :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants