Angular/TS auto import and navigation to components

I had this working very well a while back, but at some point it just stopped working (not sure if/probably linked to a version change, cannot identify which one)

Long story short:

1 - When using custom or Angular's native classes that aren't already imported, it will suggest importing the proper class maybe 20% of the time only. The remainder of the time it will just be completely clueless about what this class is and when pressing alt-enter it will suggest to create the member in the class

2 - Before, I could navigate to a custom Angular component by cmd-clicking on the component's selector in the HTML template (it would open the corresponding .ts file). Now it just won't work

I completely uninstalled IntelliJ (cleared Caches, Preferences, etc) and reinstalled the latest stable version, reinstalled plugins, etc. Those issues are still present.

It seemed to have fixed some other smaller issues I had (auto-imported path of classes were absolute instead of relative, bootstrap classes suggestions in html are back), but the 2 point above still remains

Any ideas? (pun maybe intended)

 

Thanks

0
3 comments

Do you have @angular node_modules included in your project? Please make sure that this module is not marked as excluded

0
Avatar
Permanently deleted user

Haaaaa I see, now that I think of it, it does make sense...

Shouldn't this "requirement" be documented somewhere? I've been searching on and off for cause/solution for a few weeks now ;)

 

Thanks for your help, it works now!

0

it's explicitly mentioned in https://blog.jetbrains.com/webstorm/2016/04/angular-2-workflow-in-webstorm/, for example:

To make WebStorm understand Angular syntax, we need to have Angular library files in our project.

 

Excluded folders are considered to be external to project - WebStorm can't use files defined there for code completion/type hinting/auto-import. That's why you need to make sure that all your direct dependencies are included in project

0

Please sign in to leave a comment.