Re: Continue Eclipse Freemarker DLTK?
Angelo zerr <[email protected]> Thu, 25 Jul 2013 16:40:28 +0200
| Newsgroups | gmane.comp.web.freemarker.devel |
|---|---|
| Message-ID | <CAKLdLg-=3nQg+xmi5oBNYMMT6DQXKQZXW5y94ys6R7_JOgZG3w@mail.gmail.com> |
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. 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 and your idea about freemaker-tool.jar is perhaps a good idea. 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). 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 2013/7/24 Daniel Dekany <[email protected]> > Continuing my last answer... (sorry I have inserted a closing sign in > the middle somehow...) > > > Wednesday, July 24, 2013, 11:21:58 AM, Angelo zerr wrote: > > > My idea is to change the FTL.jj > > > > to use a factory which creates template element. So instead to do > > that in the FMParser : > > > > ------------------------------------------------------- > > BlockAssignment ba = new BlockAssignment(block, varName, scope, nsExp); > > ------------------------------------------------------- > > > > Use a factory : > > > > ------------------------------------------------------- > > IBlockAssignment ba = factory.newBlockAssignment(block, varName, scope, > nsExp); > > ------------------------------------------------------- > > > > IBlockAssignment is an interface. By using a factory gives you the > > capability to use our own structure. For Freemarker, teh factory > > will create IIBlockAssignment with existing IBlockAssignment > > For DLTK, factory will create IIBlockAssignment with > > DLTKIBlockAssignment which will implement DLTK ASTNode. > > > > What do you think about that? > > If we will need a such detailed AST then that's probably the good > approach. But as I have written earlier, that's something that should > be avoided, if it can be. I'm not 100% sure it can be avoided, but I > hope it can be. > > FM has a quite detailed *internal* AST traversal API since 2.3.20. > It's a nasty one, tries to minimize runtime impact etc., but it's not > for the public so I thought it's OK. So if we could explore what > information is *actually* needed for the DTLK plugin, then I could > implement an API that gives you just that information through a nicer > public API. Maybe in the form of a tree, through the visitor pattern, > for some queries. I don't want to pass in AST nodes, only the > information needed. As you move along, and you realize new things are > needed, the capabilities of this tools API would be extended, and the > point is, it will belong to the FreeMarker project, not to the DLTK > project. So if I add a new feature, it's my responsibility to bring it > up to date. What do you think about this approach? > > > Regards Angelo > > > > ------------------------------------------------------------------------------ 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