I've been playing around with one of the features that we've most wanted in IDEA - freemarker support. The syntax highlighting seems to be working well so far from what I can tell, however I'm really having issues with trying to get IDEA to recognize and autocomplete variables.
A bit of background on our application. The view layer is struts2 and freemarker based glued together via spring 2.5. We have a custom class which extends struts2's FreemarkerManager where we inject a variety of objects into freemarker's context.
One of the things that struts2 injects into the freemarker context is a bunch of models for things like url, text, etc all under the 's' prefix if you will. Here's a couple of example usages
When I attempt to tell IDEA how to resolve 's' it requires a class name ... whereas in this case the likeliest way to resolve it is via a .tld file. The best I could come up with is
[#-- @ftlvariable name="s" type="org.apache.struts2.views.freemarker.tags.StrutsModels" --]
However that doesn't really seem to do the trick as IDEA now knows about the tag names but nothing about their attributes.
Also, for references like this:
The 'view' variable is really a reference to CommunityAction.getView() and 'statics' is literally just a special map injected into the freemarker context. Is there way to have IDEA figure out the 'action' resolution from the struts configuration files? The linkage is already there:
Though of course I also can't figure out how to tell IDEA that /template/ resolves to xyz directory so until I can do that ...
Any help is appreciated.