How to have scripts from <genericTag> be formatted by IDE as Javascript?

Answered

I'm working with Lithium (Lithium.com), which means working in Freemaker (.ftl) files. 

Best practice to add a script is to use a Freemarker macro <@liaAddScript> (JavaScript here) </@liaAddScript> that adds whatever script is there to the app's JavaScript files. 

However, this renders the script as plain white, unformatted text. 

How can I configure IntelliJ to display / treat what's between the <@liaAddScript> tags as JavaScript?

0
6 comments

Thanks Serge. Is there no way to just add it to the code style file as an option for JS? 

0

There doesn't seem to be an easy fix for that via IDE configuration.

0

Is there a code/language injection IDE (editor) comment I can put in the file itself? I seem to remember being able to do that in the past with another code type ... ?

Or create a new Intention or such?

0

Support for that requires the code change in the Freemarker plug-in.

0

Please sign in to leave a comment.