[
https://issues.jboss.org/browse/JBIDE-18752?page=com.atlassian.jira.plugi...
]
Matteo Pelucco commented on JBIDE-18752:
----------------------------------------
I've just tested: WIN8.1 + LUNA (SR2) + JBoss Tools 4.2.2 Final.
No supports by default for [ directive ]
If I try to add [#ftl] at the beginning of a template, it crash (no colours, weird keybord
input responses..)
On WIN8.1 + LUNA (R) + JBoss Tools (Freemarker IDE 1.3.100)
Support for [ directive ] working pretty fine.
Waiting for a fix (or maybe, an option to enable / disable it..)
Sample template: just create a new file: test.ftl and start typing [#ftl]
You will start to see weird things, like:
[#ftl
]
or
[#ft ]l
Other more complex templates completely crashes. Something like
---
[#assign urlOg = nectarfn.createAbsoluteLink(content)!""]
[#assign defaultBaseUrl = nectarfn.defaultBaseUrl!""]
[#assign siteTitleOg = siteTitle!""]
[#assign pageTitleOg = contentPageTitle!""]
[#if siteTitleOg?has_content && siteTitleOg != "" && pageTitleOg
!= siteTitleOg]
[#assign pageTitleOg = "${pageTitleOg} - ${siteTitleOg}"]
[/#if]
[#assign imgOg = stkfn.getAssetLink(content, "teaserImg")!""]
[#if imgOg?has_content]
[#assign imgOg = defaultBaseUrl + imgOg]
[/#if]
[#assign abstractPageOg = content.abstract!""]
[#assign abstractPageOg = abstractPageOg?replace("<br />", "
")]
[#assign abstractPageOg = abstractPageOg?replace("<br/>", " ")]
[#assign abstractPageOg = abstractPageOg?replace("<br>", " ")]
Freemarker plugin does not work for square bracket (since JBT
4.2.0.Final)
--------------------------------------------------------------------------
Key: JBIDE-18752
URL:
https://issues.jboss.org/browse/JBIDE-18752
Project: Tools (JBoss Tools)
Issue Type: Bug
Components: freemarker
Affects Versions: 4.2.0.Final
Reporter: Denis Golovin
Assignee: Max Rydahl Andersen
Fix For: 4.3.0.Alpha2
From
https://github.com/jbosstools/jbosstools-freemarker/issues/26
{quote}
When using the plugin to edit freemarker files that use the square bracket syntax the
editor fails to highlight the syntax (this is happening in JBoss Tools 4.20 Final).
I think the file: src / org / jboss / ide / eclipse / freemarker / editor /
DocumentProvider.java
on line 70 is causing the syntax highlighting problem:
{code}if (ch != LexicalConstants.SQUARE_SYNTAX_MARKER.charAt(i)) {
return SyntaxMode.ANGLE;
}
SQUARE_SYNTAX_MARKER.charAt(i)
{code}
It should start in 0 and have a different index than i (the index of the file content) to
have a proper string matching. Also, SQUARE_SYNTAX_MARKER is [#ftl, not all files start
with a ftl tag, so I don't see the need for "ftl" at the end, so that's
why in the following example fix I put j < 2.
e.g.
{code}
int j =0;
for (; i < docLength && j < 2; i++) {
char ch = document.getChar(i);
if (ch != LexicalConstants.SQUARE_SYNTAX_MARKER.charAt(j)) {
return SyntaxMode.ANGLE;
}
j++;
}
{code}
{quote}
--
This message was sent by Atlassian JIRA
(v6.3.11#6341)