microsoft / VS-Macros

An extension for Visual Studio 2013+ that enables the use of macros in the IDE. The extension can record most of the features in Visual Studio including text editing operations.
Other
131 stars 41 forks source link

How to debug? #48

Open EmkioA opened 7 years ago

EmkioA commented 7 years ago

as stated earlier, no break point possible.

alert() is not working too.

EmkioA commented 7 years ago

Why use JavaScript as language, we are into Visual Studio, why not use c# and/or vb?

daiplusplus commented 1 year ago

I've found I can do rudimentary print-style debugging via the VS Output window:

var vsWindowKindOutput = "{34E76E81-EE4A-11D0-AE2E-00A0C90FFFC3}";

var outputWindow  = dte.Windows.Item( vsWindowKindOutput );
outputWindow.Activate();

var outputWindow2 = outputWindow.Object; // <-- Weird: https://learn.microsoft.com/en-us/dotnet/api/envdte.outputwindowpanes
var outputPane1   = outputWindow2.ActivePane;
var outputPane2   = outputWindow2.OutputWindowPanes.Item( 1 /* name */ );

outputPane1.Activate(); // <-- Is this necessary?
outputPane1.OutputString( new Date() );
outputPane1.OutputString( "\r\n" );

(This code currently re-uses the current Output pane as I'm having problems with OutputWindowPanes.Add( "MyMacro Output" ) not working reliably.

Screenshot proof:

image