Ionic Tags not recognized

Answered

Why are the Ionic tags like <ion-app> is not recognized by Intellij IDEA?

The application is runnig without problemt, only  the  IONIC code completion is not working and the tags are marked as "custom tags".

Would be great if someone could give me a hint :-)

0
8 comments

IntelliJ IDEA has not support for these tags. How would it recognize them without any metadata, DTD, XSD, etc or a custom plug-in that would let IDE know about it?

0

Hi Chris, 
make sure that you have the Angular plugin installed and also check that you do not have the node_modules folder marked as excluded (right click on the folder, go to "Mark Directory As" and click "Cancel Exclusion").  With this it should work

 

1

Hey there!

Isn't there any other way to detect ionic tags without including node_modules folder? 

This way is a pain when doing a global search…

0

No way; the Ionic/Angular support heavily depends on node_modules contents to provide you with most of the code insight support.

0

But then the global search becomes mostly useless since it includes `node_modules` in the scope. Isn't it? Or am I missing something?

0

When using Find in Files feature, you can use In Project scope when searching - it doesn't include libraries, so you won't see files from node_modules in search result when using it. JavaScript libraries are only included when using Directory scope with corresponding folder selected, or when using custom scope with explicit filters. Excluding libraries from custom scope is a bit tricky... To make it work, you need to prefix your scope pattern with file[your_project_name]:*/&& to overwrite the default scope - see https://youtrack.jetbrains.com/issue/IDEA-145142#comment=27-1156171 for explanation.

0

I deleted `.idea` and `node_modules`, Invalidated all caches and restarted the project. This fixed the problem without including `node_modules` directory. I'm not sure why some solutions here pointed that way though.

Keep in mind after removing `.idea` you might loose the project tree explorer. I followed this answer to fix it

0

I deleted `.idea` and `node_modules`, Invalidated all caches and restarted the project. This fixed the problem without including `node_modules` directory.

 

When you did this, the node_modules library that includes all direct dependencies from your package.json was auto-created, so the required packages were included in index (so you actually did include node_modules).

0

Please sign in to leave a comment.