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?
Please sign in to leave a comment.
Please follow https://youtrack.jetbrains.com/issue/IDEA-172671 for updates.
There was also a similar question in this forum: https://intellij-support.jetbrains.com/hc/en-us/community/posts/115000234444-Custom-JS-tag-in-ftl-file
Thanks Serge. Is there no way to just add it to the code style file as an option for JS?
There doesn't seem to be an easy fix for that via IDE configuration.
ok thanks.
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?
Support for that requires the code change in the Freemarker plug-in.