how can I get intellisense in a T4 template?

Visual StudioVisual Studio-2008IntellisenseT4

Visual Studio Problem Overview


When trying out these tutorials (T4 Tutorial: Creating reusable code generation templates) I noticed that although I was using plain c# I didn't get any intellisense, probably because of the file extension (.tt)

Isn't there anyway to say to Visual Studio to consider those .tt files as .cs files and thus get the correct intellisense help?

Visual Studio Solutions


Solution 1 - Visual Studio

Resharper can do this, with the help of the ForTea Plugin that adds support for editing T4 (.tt) files.

Solution 2 - Visual Studio

http://visualstudiogallery.msdn.microsoft.com/en-us/60297607-5fd4-4da4-97e1-3715e90c1a23

Here you go with a plugin...

Vaseem.

EDIT

Also available for Visual Studio 2012: Tangible T4 Editor 2.3.0
Also available for Visual Studio 2015: Tangible T4 Editor 2.3.0
Also available for Visual Studio 2017: Tangible T4 Editor 2.4.0
Also available for Visual Studio 2019: Tangible T4 Editor 2.5.0

Solution 3 - Visual Studio

You can just download tangible's T4 Editor at

Solution 4 - Visual Studio

You can purchase the professional version of T4 Editor. It works very well in standalone .tt files, but unfortunately, due to the differences in how the pro version of T4 Editor and T4 itself compile the templates, you will get false errors reported for this tutorial, which relies on T4 Toolbox.

Solution 5 - Visual Studio

As Scott Hanselman also points out, the intellisense you might be expecting from some of the videos and articles on T4 are not built in to VS2008, you need the T4 Editor from Clarius, but they do have a community edition with some minimalist features to get you started.

Solution 6 - Visual Studio

I found the devart T4 editor has all the features I was looking for in a Visual Studio Extension for free. It's all native. Feels like editing any other source file.

https://www.devart.com/t4-editor/download.html

Solution 7 - Visual Studio

For some reasons, I couldn't install the extensions mentionned in the other answers. My solution was to use Visual Studio Code to edit the .tt files. VS Code has some good t4 synthax highlighter plugins.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionVitor SilvaView Question on Stackoverflow
Solution 1 - Visual StudioDanView Answer on Stackoverflow
Solution 2 - Visual StudioMohammed Vaseem SiddiquiView Answer on Stackoverflow
Solution 3 - Visual StudioTobeView Answer on Stackoverflow
Solution 4 - Visual StudioOleg SychView Answer on Stackoverflow
Solution 5 - Visual StudiorohancraggView Answer on Stackoverflow
Solution 6 - Visual StudioHackSlashView Answer on Stackoverflow
Solution 7 - Visual StudioMaxterView Answer on Stackoverflow