FileTemplates not registering

Hi,

I have read all that I can read about this in the forums here, I am somehwat new to plugin dev in IntelliJ, so I tried to get this myself be fore asking. :)

The call for the Template;

final FileTemplate template = FileTemplateManager.getInstance().getTemplate("ModuleClass.as");

The location of the template;

/PluginProject/resources/fileTemplates/ModuleClass.as.ft

I have put the following in Compiler > Resource patterns

;*.ft

With the following, it seems like I am verbatum copying what everybody else is doing but when I run the plugin debug I am always recieving null for the return value of getTemplate().

Any glaring mistakes or gotchas I am not thinking about?

One thing to note is in the debug version of IDEA, if I got to File Templates in Project settings, the two template entries show up in Java EE Tab in my group I assigned, but if you click on the items in the Tree, no template data shows in the preview pain, so obviously the template data dosn't seem to be getting compiled into the plugin.

Thanks,
Mike

2 comments

Hi Michael,
First, please check whether the "fileTemplates/ModuleClass.as.ft" is actually copied to the output directory of your module.
If it is not copied, then the reason should be in resource compiler settings:
1. the /PluginProject/resources must be marked as a source directory and *.ft extension is added to resource patterns list.
2. if your project is maven-based and was imported from pom.xml, then only those resources that are configured in pom.xml, are taken into account, IDEA's settings are ingored for "mavenized" modules

Hope this helps to diagnose the problem.

Eugene.

0

OH! I feel like a complete idiot!

I did not add the resources folder to the source path. Man, I wasted 4 hours yesterday because of a source folder, hahah. Thank you so much! :)

Everything works fine now.

Mike

0

Please sign in to leave a comment.