The IVsSingleFileGenerator interface has a call to the void Generate (...) method, which has a parameter of type IVsGeneratorProgress . This interface has a void GeneratorError () method that allows you to report errors and warnings to the Visual Studio error list. GenerateError () takes a row and a column among other parameters, so I assume that double-clicking your custom error will lead you to the appropriate place in the source file.
To put it all together, I would do something like the following:
public class MyGenerator : IVsSingleFileGenerator { public Generate(string path, string inputContents, string namespace, IntPtr[] outputContents, out unit outputLength, IVsGeneratorProgress progress) {
Compile this into an assembly. (I donβt understand if this is an EXE or a DLL, but I suspect it will work because you have a class that implements the correct interface.) Then go to the properties of each SQL file in your project and associate the MyGenerator user tool with it. When you compile the project, Visual Studio should now run its own tool and generate output in the error window.
source share