Reference to other module's web context root inside Freemarker <import> Statement
已回答
I have the following statement in a Freemarker template:
<#import "/module-name_WEB_CONTEXT_/common_macros.ftl" as common>
The file "common_macros.ftl" is located in a separate module ("module-name") inside the "webapp" directory.
What would be the best way to let IntelliJ resolve the "module-name_WEB_CONTEXT_" part to a folder inside another module?
It seems that the FtlFileReferenceDirective or the FtlImportDirective do not have Extension Points for this?
请先登录再写评论。
If you're looking for an extension to implement in a plugin, com.intellij.freemarker.psi.files.FtlGlobalVariableProvider#getSpecialFileReferenceValues might help. But first I'd suggest to try @ftlroot hint, described in https://www.jetbrains.com/help/idea/template-data-languages.html.
Thanks, it works perfectly (using a FtlGlobalVariableProvider).