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.

Bug 144971 - freemarker coloring and syntax ... - plugin available
Summary: freemarker coloring and syntax ... - plugin available
Status: NEW
Alias: None
Product: editor
Classification: Unclassified
Component: -- Other -- (show other bugs)
Version: 8.0.1
Hardware: All All
: P1 blocker with 26 votes (vote)
Assignee: Milutin Kristofic
Depends on:
Reported: 2008-08-25 07:07 UTC by luismolina
Modified: 2016-07-01 18:25 UTC (History)
5 users (show)

See Also:
Exception Reporter:


Note You need to log in before you can comment on or make changes to this bug.
Description luismolina 2008-08-25 07:07:22 UTC
hi, i cant imagine why if freemarker its used for the templates, it has no intellisense neither color sintax..
Comment 1 Tomas Danek 2008-08-27 10:40:54 UTC
Not sure where would you like to highlight and what..
Comment 2 luismolina 2008-08-27 11:01:34 UTC
i want sintax coloring for freemarker templates .ftl in netbeans ide...
Comment 3 Vitezslav Stejskal 2008-08-28 13:44:58 UTC
Would be useful, thanks.
Comment 4 alec_c4 2008-09-09 13:42:51 UTC
it will be nice to have this functionality for netbeans. also - it will be great if netbeans will work with velocity
Comment 5 gborkowski 2010-10-09 21:21:03 UTC
I also need FreeMarker support in Netbeans. The case is that we use freemarker templates for sending e-mails. Currently, netbeans treats .ftl files like plain text. No syntax higligting. This makes is very difficult to edit the template which contains several nested loops: very soon you get lost when such loop ends, for example.
So from my perspective, the minimum which should be provided by netbeans would be syntax highlighting (one color for text, one for directives, one for ${...} expressions), and higlighting for the matching start-end directive tags (the same you get in html file for example). This is really important feature - I tried to use jEdit, which has syntax highlighting for freemarker, but doesn't mark matching start-end tags, so it's not of much help.

Having code completion would be great too, but it's not crucial (you can learn freemarker syntax and directives on your own withouth code completion; but without syntax highlighting, even freemarker expert can get lost when working on bigger templates).

Besides, freemarker is quite popular tool as a view generation strategy in web applications, is also used for netbeans templates, and was planned to be used in netbeans UML module for code generation (I don't know if it was actually implemented). So it would be really helpful to have at least basic support for freemarker.

There was a plugin written by Geertjan for 6.0 I think (called "freemarker fun pack") but it was never accassible on plugins list, its installation was strange (see issue 156605), and, anyway, it used now-deprecated Schliemann modules, and doesn't work any longer under 6.9.1 (I was able to install it under 6.8, but it caused IDE crashes, so I had to to disable it; under 6.9.1 I wasn't able to run it at all). So definitely there is a need for something new here.
Comment 6 lesar 2011-04-21 11:35:55 UTC
Would be useful, thanks.
In eclipse I have use eclipse plugin to edit freemarker .ftl file.
Is not easy to work without syntax highlight
Comment 7 agallardo 2012-01-27 17:47:24 UTC
I'd be great if the user could also provide the target file format, to provide two level syntax highlighting.

For example, if using freemarker to template jsp's, the .ftl file extension would tell the IDE to turn on freemarker syntax highlighting. Additionally, the user should be able to refine the type of template, so jsp syntax highlighting would be also activated.
Comment 8 morten_hattesen 2012-02-01 13:47:55 UTC
This request has existed since 2008. The only freemarker support is a plugin was witten in 2007, is not being maintained, and no longer works in Netbeans 7.x

Please consider increasing priority
Comment 9 rgm3 2012-05-16 16:38:26 UTC
There is an old broken plugin along these lines here:

The purpose of this plugin is to serve as an example project to build a plugin.  Once you compile it you can create an NBM file using the project from that plugin that used to provide Freemarker highlighting.  Even after tweaking the project to compile in Netbeans 7.1.2, the resultant plugin does not work well (bad coloring, hangs IDE).  There is no "Freemarker" item in the "Languages" menu, although there is a "text/x-freemarker" mime type option in Preferences -> Misc -> Files.
Comment 10 morten_hattesen 2012-09-06 07:42:21 UTC
Any chance of getting some focus on this issue.

No functioning Freemarker IDE support (syntax highlighting, Navigation) exists for NetBeans 7.x and this is a major deficiency compared to other IDE's (Eclipse has a plugin and IntelliJ has out-of-the-box syntax highlighting).

This issue has been in "Status: NEW" ever since its original reporting in 2008, no Target milestone is set, and no progress is being made.
Comment 11 Milutin Kristofic 2012-09-06 09:47:24 UTC
I am sorry, it's not in plan for 7.3. It is in top voted enhancements so there is good chance to get in next release.
Comment 12 rgm3 2012-09-06 15:57:05 UTC
Geertjan has made some progress on this issue this year, and written some great blog posts about the process:

The syntax highlighting alone would be a tremendous boon.  I hope that you can work with him to include his work in a release soon, even if it lacks sexy features like those described in the "HTML Embedding" blog post.
Comment 13 morten_hattesen 2012-09-06 19:30:24 UTC
I am not aware of any requirement- or specification document for the Freemarker support in NetBeans, so I'll use this issue to log a few feature requests:

1. Alternative syntax (square brackets)
Please remember that the Syntax highlighting needs to support the default <#xxx /> syntax as well as the [#xxx /] syntax. The square bracket syntax is generally used to make freemarker markup stand out more clearly when interspersed with html/xml template text. Other plugins/highlighters have missed this feature in early revisions. See for details.

2. Allow ctrl-click navigation into templates imported using <#include path> and <#import path>.

3. Allow ctrl-click navigation into Freemarker functions and macros ${functionName()} and <@macroName /> (ideally even when those functions/macros are defined in included or imported templates.
Comment 14 rgm3 2012-09-14 18:23:27 UTC
Geertjan has shared his latest Freemarker support source code here:
Comment 15 andidev 2013-04-29 08:13:52 UTC
(In reply to comment #14)
> Geertjan has shared his latest Freemarker support source code here:

This plugin does not work for 7.3 though.
Comment 16 mcmagi 2013-04-29 16:23:25 UTC
It does work in NB7.3, but installing the NBM file does not work.  It complains of a missing "Lexer to Netbeans Bridge" dependency.  I could only get it to install if I downloaded the entire project, loaded it into NetBeans and chose "Install/Reload in Development IDE".
Comment 17 elennaro 2014-07-05 09:24:13 UTC
Please, it will be very good for most of developers to see some progress about freemarker.
Comment 18 nuboat 2014-10-20 16:22:52 UTC
For Servlet, I has renamed .ftl to .xhtml. 

It's worked
Comment 19 elennaro 2015-02-28 11:01:37 UTC
Does 22 votes and a bunch of similar issues for a lot of template engines for Java and NodeJS act somehow?

Please, please, show us any progress in this direction!
Comment 20 elennaro 2015-03-18 18:08:23 UTC
According to WiKi this one should become P2 (more than 10 duplicates + votes).
Comment 21 elennaro 2015-03-20 15:27:01 UTC
According to WiKi this one should become even P1 (more than 20 duplicates + votes).
Comment 22 chriswareham 2015-03-24 18:05:40 UTC
The existing Freemarker plugin can be installed in NetBeans 8.x with the following instructions:

Download the latest source from GitHub:
(Click the "Download Zip" button).

Ensure you have the "NetBeans Plugin Development" plugin installed (it should be installed by default, but check in case).

Unzip the source you downloaded from GitHub, and open the resulting folder as a project in NetBeans. Right click on the root folder of the project in the Projects window. Select "Install/Reload In Development IDE" from the popup menu.

Click through a warning dialog if you see one, the plugin should then build and install into your NetBeans installation.

Open a Freemarker file with an .ftl extension, and you should see it syntax highlighted.
Comment 23 elennaro 2015-03-24 18:15:02 UTC
And what about *.html extention?
Is it avaliable from plugin portal?
Comment 24 chriswareham 2015-03-25 09:49:51 UTC
Th plugin isn't available in a NetBeans 8.x compatible version from the Plugin Portal. I'll see if I can upload one, but it's not something I have ever done before.

As for Freemarker templates with a .html extension, the plugin only seems to recognise templates with an .ftl extension. I'm not sure why you would want to give your templates a .html extension anyway.
Comment 25 elennaro 2015-03-25 12:45:49 UTC
Earlier there was a problem with html and angular cc on .ftl files when I was using this plugin. I was able to work it around by adding file.html.ftl extention.
But it was on 7.4, now I don't use freemarker yet.
Comment 26 rostanek 2015-05-22 21:22:13 UTC
Hello everyone,
I created my own plugin which supports version 7.4 and 8.0. You can download it from here:
or by Update Center.
I am waiting for your feedback. You can submit issues on github.