Gaston Milano's WebLog

About something...

News

General

Usability

VS Automation

VSIP

T4 Editor and GAT

After I uploaded the T4 Editor I had very good feedback but people that was working with GAT (Guidance Automation Toolkit) had not coloring for .t4 extensions. Add .t4 extension to the list was the easier part in order to support .t4 templates.

When you install GAT from here it installs a special host for .t4 templates and a new cool processor "property processor" that define template properties to pass parameters to the template. For example this template receive a property called Number.

<#@ property processor="PropertyProcessor" name="Number" type="System.Int32" #>

Based on this I did the following things:

  • Coloring property as built-in directive (see screenshots)
  • Intellitips for properties (see screenshots)
  • You can set the value for properties using the visual studio property grid
  • You can right click and run the template. It will use the GAT Host if the extension is .t4 and pass the properties.
  • If you need Debug, just set the breakpoint (generally F9) and start debug (F5) !!
  • You can set conditionally breakpoints ;)

The debugger will open the generator source instead of the .t4 file, I could be great if we can tell to the engine what is the name of the file to debug.

 

Believe me or not I did a Setup this time !!

Requeriments

  1. Visual Studio 2005
  2. If you want to use the .t4 extension and run templates so install GAT

You don't need to install Visual Studio SDK if you want to work only with .t4 templates.

 

 

 

 

 

Comments

Mohamed A. Meligy said:

Hi,
Well, I have to admit that I don't understand this yet, but, I have a main question:
Is that a replacement for Codesmith and such tool ??
Thank you,
# March 21, 2006 9:11 PM

GMilano said:

Essentially it is the same template technology, there is a extensible template engine generator and I suppose there will be a lot of technology around T4 engine.
I guess it will be a replacement for any similar template engine technology.

I forgot this: it is free ;)

# March 21, 2006 10:18 PM

Paolo Arrigoni said:

Hi to all,
I'm using the t4 editor for templates wrote in DSL Tools designer...
The syntax completion seems to function, but with this.MyDiagramComponent doesn't work... What am I Failing?
Is possible to obtain this?
tnx in advance for the help...
Paolo Arrigoni
# April 10, 2006 11:01 AM

JUrbanowicz said:

Some of my temples lose the keyboard arrow s, backspace and home,end.. keys. When I removed your t4 editor everything worked, but I cant go back to Black and white once I've had Color.
Any ideas?
Thanks great addition,
Jay
# April 13, 2006 6:47 PM

Andres Aguiar's Weblog said:

Microsoft is shipping T4,&amp;nbsp;an ASP-like template engine. It's included in the 'Guidance Automation...
# May 22, 2006 3:12 PM

Jason L said:

Hi, the link to the setup file is dead. :(

# August 1, 2007 11:38 AM

Reza Rahmati said:

Does it work for vs2008?

# December 4, 2008 1:43 AM
Leave a Comment

(required) 

(required) 

(optional)

(required)