Visual Studio VSPackage / Single File Generator - Log to Error List

I am working on creating a Visual Studio VSPackage containing a single-file generator ( IVsSingleFileGenerator ), and I want to be able to log events in the Visual Studio error list ( http://msdn.microsoft.com/en-us/library/33df3b7a(v=vs .110) .aspx )

I use base class examples from the Microsoft Visual Studio SDK ( http://code.msdn.microsoft.com/windowsdesktop/Single-File-Generator-94d856d4 ). These classes have methods:

 public class BaseCodeGenerator : IVsSingleFileGenerator { void GeneratorError(uint level, string message, uint line, uint column); void GeneratorWarning(uint level, string message, uint line, uint column); } 

This allows me to make errors and warnings, but not messages. IVsGeneratorProgress.GenerateError calling IVsGeneratorProgress.GenerateError ( http://msdn.microsoft.com/en-US/library/microsoft.visualstudio.shell.interop.ivsgeneratorprogress.generatorerror(v=vs.90).aspx ). This method does not allow me to attach a "message".

I tried to find a link to the Error List window in Visual Studio so that I could write directly to it, but did not see anything in VSConstants ( http://msdn.microsoft.com/en-us/library/microsoft.visualstudio.vsconstants (v = vs. 80) .aspx ).

Does anyone know how to write a message to the Visual Studio error list?

+4
source share
2 answers

Not a direct answer, as I do not think I have ever solved this. I decided to create and write a new output window. If you need help, see the WriteLine Method at the bottom of this source: http://code.google.com/p/csharptest-net/source/browse/src/Tools/CmdTool/VsInterop/BaseCodeGeneratorWithSite.cs

I think that OutputTaskItemString can even do what you ask.

+2
source

It just doesn't fit, the error list window can and should display error messages and warnings. Therefore, automation interfaces will not help you do this.

If you want to create additional chatter, then you must write this in the Output window. Accessed via the IVsOutputWindowPane interface, this MSDN method shows an example of source code in the LogAnnotationToOutputWindow () method.

+4
source

Source: https://habr.com/ru/post/1479757/


All Articles