cancel
Showing results for 
Search instead for 
Did you mean: 

Webscripts, import tags & IDEs

kbryd
Champ in-the-making
Champ in-the-making
Hi

How do you manage to suppress errors reported by IDEs when working with webscript JavaScript code which imports other resources? For example:


<import resource="classpath:includes/callutils.js">
function main()
{
    model.sortDef = doSomething();
}
main();

Such code will create error warnings in NetBeans, IntelliJ (and most probably in Eclipse too - I don't know as I am not using Eclipse).

Do you know if there is another way to import JS files which does not break code formatting and language inspection in IDEs?

Karol
1 REPLY 1

loftux
Star Contributor
Star Contributor
Ran into this issue with IntelliJ, very new to IntelliJ and trying to switch from Eclipse. Wasn't an issue there.
I tested to add
<javascript>
//</import>
</javascript>
on the second row. That way IntelliJ see the import tag as closed and code highlighting work. The comment makes javascript parse properly. So may be a workaround, but only if you have only one import statement, for some files there are many.

Better yet would be if could use <import resouce="…" /> (ie close the tag in one line). Time to file an enhancement request.
Does anyone know if there is a way to get IntelliJ to ignore this import tag?