Thursday, March 8, 2018, 6:45:33 AM, Angelo zerr wrote:

>>
>>
>> I have looked at these briefly when you mentioned LSP, but two
>> question aren't yet clear to me:
>>
>> - Can tm4e leverage information provided by lsp4e to do semantical
>>   highlighting? (This will be relevant only for FM3 though, like for
>>   coloring data-model variable references differently than "local"
>>   variable references.)
>>
>
> A first I would like clarify something: LSP doesn't take care of syntax
> coloration.
>
> tm4e and lsp4e follow the same idea than VSCode:
>
>  * manage syntax coloration with a textmate grammar.
>  * manage completion, hover, etc with LSP
>
> tm4e and lsp4e are 2 distinct projects so you cannot use some information
> coming from lsp4e (some kind of AST) in tm4e.

I belive it's natural that these two things (heavy weight parsing and
a faster one for coloring) are executed independently. (FreeMarker IDE
does that as well.) So far so good. But when the heavy weight parser
catches up, it should apply the extra visuals. Many traditional
plugins work like that, I believe (semantic coloring used to lag
behind basic coloring in Eclipse's Java editor for example).

> tm4e support syntax coloration (and starts supporting language
> configuration configured with a JSON file for matching bracket, etc)
> with a textmate grammar. I'm not an expert with textmate grammar (uses of
> advanced regexp), but you can manage the "local" variable I think
> because in textmate grammar you have a "scope" context.
>
> If you install tm4e https://github.com/eclipse/tm4e#install, you can
> register the Freemarker textmate grammar
> https://github.com/dcortes92/vs-freemarker/blob/master/syntaxes/ftl.tmLanguage
> (with Window / Preferences -> TextMate / Grammar) and you should have
> Freemarker syntax coloration
>
>
>>
>> - Can we leverage some existing HTML/JS/CSS editor functionality with this?
>>   I mean something like in
>>   https://github.com/angelozerr/eclipse-wtp-freemarker. (By far the
>>   most often request for "FreeMarker IDE" is to do HTML syntax
>>   highlighting, but then I'm sure HTML auto-completion etc. will
>>   follow.)
>>
>
> It's a very good question:):
>
>  * for syntax coloration with texmate, you can inject textmate grammar (ex:
> Freemarker) in an existing textmate grammar (ex: HTML). I have that for
> TypeScript file
> which can contains angular syntax in their  @Component/template.
>  * for completion, etc (LSP) I think you can apply several language server
> for the same kind of file. So if you open an HTML file, it could execute
> the existing HTML language server et the Freemarker language server.

You mean, maybe, the LSP that understand FreeMarker kind of cuts out
the FreeMarker constructs and passed down the now purely HTML content
to the HTML LSP, and then combines the results?

Are the working plugins that actually do this?

>> > And it could work for other editor which supports LSP like VSCode,
>> > WebStorm, etc
>> >
>> > I think you (the question is who?) should spend your time with LSP
>> > Freemarker Server. It's an hard work but it will work with a lot of
>> > Editor/IDE.
>> >
>> > Regard's Angelo
>> >
>> > 2018-03-07 20:23 GMT+01:00 Taher Alkhateeb <slidingfilame...@gmail.com>:
>> >
>> >> Great idea. Love to help if I can
>> >>
>> >> On Mar 7, 2018 7:08 PM, "Daniel Dekany" <ddek...@apache.org> wrote:
>> >>
>> >> > The only Eclipse plugin in reasonable state for editing FreeMarker
>> >> > templates is "FreeMarker IDE", which is part of the JBoss Tools
>> >> > project. See the top entry at
>> >> > https://freemarker.apache.org/editors.html, and also
>> >> > https://github.com/jbosstools/jbosstools-freemarker.
>> >> >
>> >> > However, RedHat has deprecated and now removed the "FreeMarker IDE"
>> >> > plugin from JBoss Tools and Devstudio. See:
>> >> > https://stackoverflow.com/questions/49072160/why-is-
>> >> > freemarker-ide-in-eclipse-oxygen-jboss-tools-4-5-2-final-deprecated
>> >> > https://issues.jboss.org/browse/JBIDE-25736
>> >> >
>> >> > So I think "FreeMarker IDE" should be brought over to the ASF,
>> >> > similarly as FreeMarker-Online was. Also the Eclipse update "site"
>> >> > should be hosted on ASF infrastructure. I have started a discussion to
>> >> > explore this possibility, and so far it seems it's fine on their side:
>> >> >
>> >> > http://lists.jboss.org/pipermail/jbosstools-dev/2018-
>> March/subject.html
>> >> >
>> >> > The code is under EPL, but of course they should "contribute" the code
>> >> > the ASF where we can replace the license with ASL2, and rename the
>> >> > packages.
>> >> >
>> >> > Technically, "FreeMarker IDE" is independent of the rest of JBoss
>> >> > Tools, we only had to substitute org.jboss.tools:parent (as it's not
>> >> > in the Maven Central, it's not an acceptable dependency IMO).
>> >> >
>> >> > What do you think? Will the ASF be fine with bringing over yet another
>> >> > FreeMarker related project? Do you think it's good to do?
>> >> >
>> >> > My opinion is that the more control we have over such products, the
>> >> > easier it is to ensure that they remain maintained and available to
>> >> > the users.
>> >> >
>> >> > --
>> >> > Thanks,
>> >> >  Daniel Dekany
>> >> >
>> >> >
>> >>
>>
>> --
>> Thanks,
>>  Daniel Dekany
>>
>>

-- 
Thanks,
 Daniel Dekany

Reply via email to