Re: Continue Eclipse Freemarker DLTK?

Angelo zerr <[email protected]> Sat, 27 Jul 2013 18:06:38 +0200
Newsgroups gmane.comp.web.freemarker.devel
Message-ID <CAKLdLg9-fSfxQnYF5g7CrLgdbuc76BFYMata-5KJ+o4Z3Yha-w@mail.gmail.com>
Hi Daniel,

>I suppose the problem is that you're not sure if it will ever be
>merged. Is it?

Yes it that.

> you could just branck out 2.3-gae-dltk

I would like to avoid creating a new branch for my need about dltk.
So I prefer waiting your acceptation.

My patch it's just to use other implementation of DebuggerService, on other
words inject the DebuggerService in the Configuration (like DI).

After that I don't need to modify the debug code of FM (I will host for the
moment my dbgp debuggerservice implementation in the dltk project).

More you wish to manage stepping, I would like to benefit with this feature
too.


> One thing that caught my eyes yesterday when glancing thought this
> patch is that you add the DebuggerService to the Configuration and
> that it must be set, or else the Template will not be registered in
> the debugger service. In many (most?) cases users will want to debug
> templates whose configuration wasn't set up like that. So we will need
> a system property like -Dfreemarker.debuggerService="new Whatever()".
> That could set the default value of DebuggerService.getInstance(),
> which in turn would be the default value of cfg.debuggerService.
>

Exactly, that why I have said "Note that this patch break the creation of
RMI debugger RmiDebuggerService when freemarker.debug.password is found. We
could discuss about that (perhaps to use SPI services to register
implementation of debugger service)."

If you are OK with my patch, we could discuss how to inject with properties
like system property as you have explained.
With Java5 we can use SPI services to register debugger service, it could
be a good idea (doesn't work with java 1.4, but is it a problem?)

Regards Angelo

>
> --
> Thanks,
>  Daniel Dekany
>
>
> >> Regards Angelo
> >>
> >>
> >> --
> >> Thanks,
> >>  Daniel Dekany
> >>
> >>> Last night I have switched to FM 2.3 (the Ouline doesn't work
> >>> because I have commented code about DLTK ASTNode). See
> >>>
> https://github.com/angelozerr/Freemarker-Eclipse-DLTK/commit/915952c3eec28a4531a54edacc7e33cb88993f18
> >>>
> >>> I have removed FM 3.0 bundle (org.freemarker.freemarker) and
> >>> replaced with FM 2.3. As 2.3 is an OSGi bundle, I use it directly as
> >>> OSGi bundle (you can see in action that OSGi with FM seems working).
> >>>
> >>> You must build the freemarker.jar and set in the
> >>> TargetPlatform/plugins
> >>>
> https://github.com/angelozerr/Freemarker-Eclipse-DLTK/tree/master/TargetPlatform/plugins
> >>> if you wish to use the version from Git master.
> >>>
> >>> Now I would like to work on the debugger. I will create a new topic
> about the debugger.
> >>>
> >>> Regards Angelo
> >>>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>> 2013/7/26 Daniel Dekany <[email protected]>
> >>> Friday, July 26, 2013, 12:28:19 AM, Angelo zerr wrote:
> >>>
> >>>>> What do you mean by "manage with 2.3"?
> >>>>
> >>>> I mean that DLTK Freemarker will use FM 2.3 and not 3.0
> >>>
> >>> Sure.
> >>>
> >>>>> You want to modify FM, or it's plugin development only?
> >>>>
> >>>> My first step is just modify or comments code of DLTK Freemarker.
> >>>>
> >>>> After I would like contribute with my code
> >>>>
> https://github.com/angelozerr/Freemarker-Eclipse-DLTK/tree/master/freemarker.provisionnal/src/freemarker/provisionnal
> >>>> to FM to improve debugger and contribute to FM tools.
> >>>>
> >>>>> I'm OK with both, except that you will have
> >>>>> to send a signed Contributor License Agreement for modifying FM
> >>>>> itself.
> >>>>
> >>>>> In last past I had send a CLA to Atila (to commit in the svn FM), is
> not enough?
> >>>
> >>> That's enough. Sorry for the confusion, it's just that I don't have a
> >>> copy of that here for some reason... never mind.
> >>>
> >>>> Regards Angelo
> >>>>
> >>>> --
> >>>> Thanks,
> >>>>  Daniel Dekany
> >>>>
> >>>>
> >>>>> Regards Angelo
> >>>>>
> >>>>>
> >>>>> 2013/7/25 Daniel Dekany <[email protected]>
> >>>>> Thursday, July 25, 2013, 4:40:28 PM, Angelo zerr wrote:
> >>>>>
> >>>>>> Hi Daniel,
> >>>>>>
> >>>>>> OK I understand why you don't want expose the AST API. Thank's for
> your information.
> >>>>>>
> >>>>>> The DLTK ASTNode is used for several features like folding,
> >>>>>> refactoring, search, codeassist.
> >>>>>>
> >>>>>> You can read info about ASTNode at
> >>>>>> http://wiki.eclipse.org/DLTK_Core_Architecture
> >>>>>> It's difficult for me to tell you now which info are required  to
> >>>>>> build a DLTK ASTNode.
> >>>>>
> >>>>> Then, to start somewhere... I think, org.freemarker:tooling will give
> >>>>> you an abstract FTLVisitor class, which however will only have two
> >>>>> kind of visit-s for now: visit(ElementInfo) and
> visit(ExpressionInfo).
> >>>>> (That's so that the plugin or other tools won't assume that they know
> >>>>> all the directives and expression types.) (Note that the 3.0 API
> >>>>> didn't visit expressions at all, only elements.) And then I start
> >>>>> adding properties to these XxxInfo-s as the need arises. Like,
> >>>>> isFoldable(), isOutlineNode and getOutlineNodeLabel for starters. The
> >>>>> initial "accept" method of the tools API could have a Query object (a
> >>>>> JavaBean again) as parameter, in which you can specify what are you
> >>>>> interested in (like, folding and/or outline nodes and/or variables
> >>>>> used, etc). So as you move ahead, we will see if it's appropriate at
> >>>>> all. And of course I'm open for suggestions.
> >>>>>
> >>>>>> I will try to switch to 2.3 and I will see what we need.
> >>>>>>
> >>>>>> My work about AST was very simply (I have just managed #assign in
> >>>>>> the AST to display the variable name of assign in the Outline View).
> >>>>>> But perhaps for Freemarker, the Outline View should display more
> >>>>>> info like JBoss IDE
> >>>>>
> >>>>> JBoss IDE's outline is useless IMAO. It shows far too much. After
> all,
> >>>>> the goal of an outline view is to show you a summary that's good for
> >>>>> navigation (among others). Although I'm not entirely sure how the
> >>>>> outlook should look. It has to show #macro and #function, and that's
> >>>>> already useful, but what else?
> >>>>>
> >>>>>> and your idea about freemaker-tool.jar is perhaps a good idea.
> >>>>>
> >>>>> (I wonder what's the proper term is. "tooling" or "tools"? Like
> >>>>> "FreeMarker Tooling API" or "FreeMarker Tools API"... or even
> >>>>> "tool-helpers"...)
> >>>>>
> >>>>>> I have not experimented a lot the capability of the DLTK ASTNode
> >>>>>> but at the end of the
> http://wiki.eclipse.org/DLTK_Core_Architecture
> >>>>>> it says "Use of the DLTK AST is not mandatory, but some DLTK
> >>>>>> features like folding may rely on it and it can greatly simplify
> implementation."
> >>>>>>
> >>>>>> For the completion (interpolation) I don't use the ASTNode but I
> >>>>>> think I should to use it (so I need a more complex AST).
> >>>>>
> >>>>> For that you need the variable names used, in a hierarchy. Like, on
> >>>>> the top-level you have "user" and "department", but after "user." the
> >>>>> possibilities are different, like "user.name" etc. If DLTK can
> extract
> >>>>> such info from the AST, we might as well add that in ExpressionInfo.
> >>>>> Also there's the case where some of the data-model variables has a
> >>>>> known class (that's not a FreeMarker feature).
> >>>>>
> >>>>>> So I must switch to 2.3, my first idea is to try to remove the use
> >>>>>> of DLTK ASTNode an dmanage other features like syntax errors and
> debug.
> >>>>>>
> >>>>>> Regards Angelo
> >>>>>
> >>>>> --
> >>>>> Thanks,
> >>>>>  Daniel Dekany
> >>>>>
> >>>>>
> >>>>>
> ------------------------------------------------------------------------------
> >>>>> See everything from the browser to the database with AppDynamics
> >>>>> Get end-to-end visibility with application monitoring from
> AppDynamics
> >>>>> Isolate bottlenecks and diagnose root cause in seconds.
> >>>>> Start your free trial of AppDynamics Pro today!
> >>>>>
> http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
> >>>>> _______________________________________________
> >>>>> FreeMarker-devel mailing list
> >>>>> [email protected]
> >>>>> https://lists.sourceforge.net/lists/listinfo/freemarker-devel
> >>>>>
> >>>>
> >>>>
> >>>
> >>> --
> >>> Thanks,
> >>>  Daniel Dekany
>
>
>
> ------------------------------------------------------------------------------
> See everything from the browser to the database with AppDynamics
> Get end-to-end visibility with application monitoring from AppDynamics
> Isolate bottlenecks and diagnose root cause in seconds.
> Start your free trial of AppDynamics Pro today!
> http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
> _______________________________________________
> FreeMarker-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/freemarker-devel
>

------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk

_______________________________________________
FreeMarker-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freemarker-devel