[stringtemplate-interest] visualizer mockup

Sam Harwell sharwell at pixelminegames.com
Mon Nov 23 16:13:13 PST 2009


Hi Gerald,

I think you have the wrong idea on what this is. The problem template
coders always run into, regardless of which IDE they use to edit
templates, is understanding how the output ties to the templates. In
essence, we're talking about a specialized debugger that operates very
much unlike other debuggers.

I'll talk about this in regards to HTML output, but it wouldn't
necessarily be HTML. Instead of outputting "plain text" from rendering a
template, it would output an HTML-formatted annotated string. One pane
could show the text that was output, but if you hover over text in it,
another pane would show you the template rendering stack at the time
that text was written along with information about the object(s)
involved in rendering. Additional possibilities might include a pane
where you can select a template and have it highlight all text it
directly and/or indirectly generated.

There's no real requirement that this be tied to a particular IDE, and
I'm not convinced an IDE has much to offer regarding this particular
feature.

Sam

-----Original Message-----
From: stringtemplate-interest-bounces at antlr.org
[mailto:stringtemplate-interest-bounces at antlr.org] On Behalf Of Gerald
Rosenberg
Sent: Monday, November 23, 2009 2:22 PM
To: Terence Parr
Cc: StringTemplate Mailing List
Subject: Re: [stringtemplate-interest] visualizer mockup

At 10:35 AM 11/23/2009, Terence Parr wrote:
>Hiya...ST v3 has a nice XML tagged output that shows which template
generated which output. I'd like an interactive thing that's easier to
read for ST v4  I'm including a mockup.
>
>It starts with a window with the generated output.  As I mouse over a
section generated by a template, it highlights (one at a time) with a
box or whatever.  I can collapse output for any expression/template.  If
I hit "get info" key it would pop up a dialog showing the template
pattern and the attribute table (an inspector).  It seems like I'd need
to detect mouse movement over a textpane and then expand and collapse
sections (hopefully w/o having to do much; perhaps replace the char
sequence with a new "collapse icon"). 

And here I thought you were a tools kinda guy; you know, pick the best
tool for the job and build on it.  Thinking of doing this stuff from
scratch is so 1999.  ;)

All of the major tools platforms (Eclipse for certain, NetBeans,
Intellij I believe) give you all of what you are asking for largely for
free: code folding, code assist, templates, code completion, and more.
Actually, a fair bit is already implemented in AntlrDT's string template
editor* -- just need to burnish the code assist adaptor and template
hierarchy visitor a bit to do the lookups.

If you are willing to go with a platform -- and there is really no
credible reason not to** -- just pick one as none would be a wrong
choice.  Even if all you want is the visualization part, without any
editor or project support, Eclipse can be stripped down to provide just
the essentials.

If you go with Eclipse, I can certainly contribute.

Best,
Gerald

---------
* at least 90% is the existing Eclipse platform implementation 
** they even have vi and emacs bindings for the old school hard-cores

_______________________________________________
stringtemplate-interest mailing list
stringtemplate-interest at antlr.org
http://www.antlr.org/mailman/listinfo/stringtemplate-interest


More information about the stringtemplate-interest mailing list