StringTemplate 4 Language Support


Basic support for the StringTemplate 4 template language.

(4) Review
Visual Studio
2015, 2013, 2012, 2010
Download (7,522)
E-mail Twitter Digg Facebook
Add to favorites
Reviews (4)
Q and A (5)
Sign in to write a review
Sort by:

by sebastian gomez | June 28 2016

Now with 2015 support the circle is complete :)

Thanks for that awesome work!

by imode | November 09 2013

Please add support for VS2013.


.vsix files are ZIP archives. I was able to edit extension.vsixmanifest and add the following under <SupportedProducts>:

<VisualStudio Version="12.0">

by Henrik Nordhaus | April 05 2013

The problem with version is that after a comment like the one shown here
<div class="clearFloat">
<!-- clear float for old IE -->
the rest of the .st file is colored as if the comment was not closed.
This seems to be a bug in your parser - please fix this, and the tool is very helpful.


Sam Harwell April 17 2013
| Edit |

Hi Hendrik. If you are not using < and > as your template delimiters, then you will need to include a delimiters clause at the top of your file. Please see the following page for syntax details:

by 0xFDED | December 18 2011

Very useful. I have a few large StringTemplate files (250+ lines, 8+ templates) and finding my way around them is MUCH easier with this tool.

Thanks for making this available.

Sign in to start a discussion

  • Visual Studio Error with .stg files
    1 Posts | Last post June 11, 2013
    • Hi Sam, I recently ran Windows update and now visual studio 2012 gives this exception when attempting to open a .stg file (from the visual studio log file).
      System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. Parameter name: lineNumber at Microsoft.VisualStudio.Text.Implementation.SimpleStringRebuilder.GetLineFromLineNumber(Int32 lineNumber) at Microsoft.VisualStudio.Text.Implementation.TextSnapshot.GetLineFromLineNumber(Int32 lineNumber) at Tvl.VisualStudio.Language.Parsing.AntlrClassifierBase`1.AdjustParseSpan(SnapshotSpan& span) at Tvl.VisualStudio.Language.Parsing.AntlrClassifierBase`1.GetClassificationSpans(SnapshotSpan span) at Microsoft.VisualStudio.Text.Classification.Implementation.ClassifierTagger.<GetTags>d__0.MoveNext() at Microsoft.VisualStudio.Text.Tagging.Implementation.TagAggregator`1.<GetTagsForBuffer>d__16.MoveNext()
      .st4 files continue to work fine.
  • No project template installed
    2 Posts | Last post March 04, 2012
    • Greetings,
      After installing the StringTemplate 4 Language Support, I restarted my VS Pro only to not find the installed template anywhere.  I have restarted the IDE and tried to reinstall the template (which fails due to already being installed) and have not been able to locate them in my project templates.  A search for ANTLR or StringTemplate returns nothing within VS New Project dialog.
      Any suggestions?
    • Hi Scionwest,
      The StringTemplate integration currently adds editor support for when you open a template file, but does not include any project or file templates.
      I may be able to include a few templates in a future version which will probably be available a few months after ANTLR 4 stabilizes enough for me to port it to C#.
  • $ build
    2 Posts | Last post March 04, 2012
    • Hiya :-)
      I'm just getting to grips with using StringTemplate for html and plaintext email templates. I'm using $ delimiters rather than the default, so I was wondering if any progress had been made with being able to set a delimiter? If not, is the source available anywhere so I could possibly build my own version that uses $'s?
      Thanks for all the hard work :-)
    • Hi Steven, You should be able to use the following syntax at the top of a group file for setting delimiters:
      delimiters "$", "$"
      I believe the following works in the editor if you're using a .st file (which doesn't support the special delimiters syntax):
      //delimiters "$", "$"
  • Great Tool
    2 Posts | Last post July 19, 2011
    • I've used and appreciated your port for the last two years (both StringTemplate and Antlr), and even this work is greatly appreciated. I look forward to future development.
      On another note, where can I ask questions and report bugs about this tool specifically, I'm having issues with the folding that I remember from the 2008 integration, that seems to be a parsing problem and mucks up the list of templates in an STG file?
    • Hi Francis, I updated my profile here (biography section) to include a feedback email address. :) I'm glad to hear the tools are helping you out, and I hope we can resolve this quickly.
  • $ support
    2 Posts | Last post July 13, 2011
    • I love using StringTemplate as a templating environment, but I use the $ delimiters extensively, when do you think that this will be supported?
    • Right now I don't have a good way to configure template delimiters for a particular file. However, I do maintain the C# port of StringTemplate and I'm in talks with the original author about adding a syntax for explicitly specifying the template delimiters within the group and/or template files.