This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
When creating a new source file of any kind it is desirable to format it using user's formatting settings (see issue 55509). For now it is necessary to invoke formatting manually from instantiating iterator. This should be simplified especially that there are many simple templates that could be done without implementing a special instantiating iterator.
After integration of issue 13250 the process shall be more or less automatic. The description is at http://openide.netbeans.org/tutorial/reviews/opinions_13250.html and says that your template shall be annotated with a templating engine to use: <attr name="javax.script.ScriptEngine" stringvalue="freemarker"/> and then the IndentEngine.find(mimeTypeOfYourFile) will be used to format your own file. Of course only if there is some useful IndentEngine registered for your mime type.
I am reassigning to editor as that is imho the place that shall provide good enough IndentEngines for generic mime types.
Well, I generally agree that editor should provide a fallback IndentEngine, which could be used when there is no better one provided by other modules. I believe that 'Simple Indentation Engine' is such an implementation. If there are any problems or suggestions for how SimpleIndentEngine works, please, file defects. Also if there are any problems with modules provided IndentEngines, please, file defects for an appropriate module. Otherwise, from editor's point of view this issue is done and can be closed. Please, reopen it, if I am missing something.
Procedure described by Jarda is not working (JSP file is parsed by the freemarker engine, but not formatted). It is because IndentEngine.find("text/x-jsp") returns SimpleFormattingEngine instead of JspFormattingEngine, which is available, but further in the list. IndentEngine.find() should prefer other implentations to SimpleFormattingEngine.
See also issue #97622
So maybe our freemarker bridge should be using the workaround described by mmetelka in issue 97622?
Reassigning to new module owner mslama.