FreeMarker directive/function scoping and includes

I'm currently working on a project that has a large number of FreeMarker templates that are dynamically concatenated by a custom template loader based on configuration settings. This allows us to insert templates that override default macro definitions when needed, allowing extensive customization. Hence, there are multiple definitions for individual macros spread throughout many of the ftl files in our project and there are no <#includes> for the editor to follow to find macro definitions.

Hence, with 8.0M1, the editor marks all of the user directives as erroneous if the macro definiton doesn't reside in the same file. Is there a way for me force the FreeMarker editor to consider all ftl files in a project to be in the same scope? Or to create filesets for scoping like you can for Spring configuration files? Also, I'd love to be able to use Ctrl-Alt-B to find all definitions of a macro. It looks like the editor only considers the last macro definition in a file to be the canonical version.

IDEADEV-27258, which refers to directives defined in Java, affects us as well and sort of falls in the same area.

Regardless of these issues, I'm amazed by the FreeMarker support. Great work.

2 comments
Comment actions Permalink

Hence, with 8.0M1, the editor marks all of the user directives as
erroneous if the macro definiton doesn't reside in the same file. Is
there a way for me force the FreeMarker editor to consider all ftl
files in a project to be in the same scope? Or to create filesets
for scoping like you can for Spring configuration files?

Since next EAP there'll be a possibility to write implicit imports in
IDEA-specific implicitly included file (created via Alt+Enter on
unresolved reference, 'define implicit variable in external file').

Also, I'd
love to be able to use Ctrl-Alt-B to find all definitions of a macro.
It looks like the editor only considers the last macro definition in
a file to be the canonical version.

This deserves a separate JIRA issue.

IDEADEV-27258,
which refers to directives defined in Java, affects us as well and
sort of falls in the same area.

Vote for it?

0
Comment actions Permalink

>> Also, I'd
>> love to be able to use Ctrl-Alt-B to find all definitions of a macro.
>> It looks like the editor only considers the last macro definition in
>> a file to be the canonical version.

This deserves a separate JIRA issue.

http://www.jetbrains.net/jira/browse/IDEADEV-29637

0

Please sign in to leave a comment.