Re: FreeMarker support for NetBeans

RafaƂ Ostanek <[email protected]> Fri, 29 May 2015 23:35:15 +0200
Newsgroups gmane.comp.web.freemarker.devel
Message-ID <[email protected]>
Thanks for the reply. Answers below.

On 2015-05-29 23:08, Daniel Dekany wrote:
> Friday, May 29, 2015, 5:35:55 PM, Rafa=B3 Ostanek wrote:
>
>> Thank you for quick reply and update on the website.
>> I will remove <@html_escape> from template in the next version.
>> Colouring of start-tag looks like that, because user directive tag
>> consists of 2 tokens: UNIFIED_CALL and ID, while UNIFIED_CALL_END is
>> full tag.
> Surely after `<@` you have a generic expression, but I think it would
> be still more logical when it comes to syntax highlighting to show
> that expression with the same color as other tag names. At least as
> far as it's just a simple dotted name.
I agree with that, but it could also be something like =

<@a_hash[a_method()]> and someone could say that it is not coloured =

properly, because it has a single colour.
I don't want to do too much hacks, so I colour tokens just like they are =

produced by FMParserTokenManager.
>
>> So I couldn't distinguish that ID from simple variable name.
>> freemarker-2.3.22.jar is embedded into the plugin, so user can't switch
>> it to different version without recompilation of the plugin. I also use
>> FTL.jj to generate lexer, so switching only jar won't work for syntax
>> colouring.
> In the case of the Eclipse plugin it was proven to be very useful to
> be able to replace freemarker.jar. I'm not sure if it can be made
> possible technically in this case. Like you are saying that you are
> using FTL.jj. So you re-JavaCC it for some reason? Can't the plugin
> just use FMParserTokenManager for example?
I tried that, but in original FTL.jj whitespace is skipped inside FTL =

expression, so it's not tokenized. In that situation lexer was not =

working properly, so I have had to modify FTL.jj to treat whitespace as =

tokens.
The freemarker.jar is used only for parsing and marking syntax errors.
>
> BTW, if you are using the real parser, maybe you aren't far from
> syntax highlight inside FTL expressions.
What do you mean? Aren't they already highlighted?
>
>> Thanks for the hint with directive names and all feedback!
>>
>> On 2015-05-28 22:37, Daniel Dekany wrote:
>>> Hi,
>>>
>>> Thanks, I have updated http://freemarker.org/editors.html!
>>>
>>> The examples when creating a new file is a bit odd. Especially
>>> <@html_escape>, which is a rarely if ever used legacy. BTW, something
>>> is off with the coloring of that stat-tag (it's mostly black after the
>>> @, not red). You may also want to tell users where to update
>>> freemarker.jar in case there are new bulilt-ins or directives they
>>> want to use but are marked as errors.
>>>
>>> (Also just in case it was missed, the list of legal directive names
>>> can be queried from there:
>>> freemarker.template.Configuration.getSupportedBuiltInDirectiveNames().
>>> There's a similar method there for built-in names, if you want to
>>> color those to at some later point.)
>>>
>>
>> ------------------------------------------------------------------------=
------
>> _______________________________________________
>> FreeMarker-devel mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/freemarker-devel
>>


---------------------------------------------------------------------------=
---