Hi, everyone. I have an advanced T4 question and I'm hoping someone can help.
I've created a SQL-like DSL, and the scripts are saved in '.satsql' files in my C# projects, like so;
// contents of myqueries.satsql
SELECT <column t1.Id> FROM <table mytable t1>
I have a .tt
file which loads the file and attempts to parse it. If it fails, I want to add an error to the Visual Studio error list, like so;
myqueries.satsql (1,8) error: unknown column 'xid' on table 't3'.
myqueries.satsql (2,9) error: bad reference: pid.
When the user clicks on the error, VS should open the 'myqueries.satsql' file and point the cursor at the appropriate line and character, just as it does for C# errors.
T4 already provides the void TextTransform.Error(string)
method, but that doesn't seem to give me the opportunity to set the file, line, and character the way C# errors do.
Does anyone know a way for a T4 file to report an error in another file -- not the T4 file itself?
Many thanks,
Steve Cooper.