From 6fe4e73ffcc88953e3b19f5e56d176d67ac9547e Mon Sep 17 00:00:00 2001 From: wuestholz Date: Mon, 21 Apr 2014 16:07:47 +0200 Subject: DafnyExtension: Made it display the compilation output in the VS output pane. --- Source/DafnyMenu/DafnyMenuPackage.cs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'Source/DafnyMenu') diff --git a/Source/DafnyMenu/DafnyMenuPackage.cs b/Source/DafnyMenu/DafnyMenuPackage.cs index 2ceaa91d..114ddf10 100644 --- a/Source/DafnyMenu/DafnyMenuPackage.cs +++ b/Source/DafnyMenu/DafnyMenuPackage.cs @@ -3,6 +3,7 @@ using System.ComponentModel.Design; using System.Diagnostics; using System.Drawing; using System.Globalization; +using System.IO; using System.Linq; using System.Runtime.InteropServices; using Microsoft.VisualStudio.ComponentModelHost; @@ -281,14 +282,26 @@ namespace DafnyLanguage.DafnyMenu toggleBVDCommand.Text = (BVDDisabled ? "Enable" : "Disable") + " BVD"; } - public void ExecuteAsCompiling(Action action) + public void ExecuteAsCompiling(Action action, TextWriter outputWriter) { IVsStatusbar statusBar = (IVsStatusbar)GetGlobalService(typeof(SVsStatusbar)); uint cookie = 0; statusBar.Progress(ref cookie, 1, "Compiling...", 0, 0); + var gowp = (IVsOutputWindowPane)GetService(typeof(SVsGeneralOutputWindowPane)); + if (gowp != null) + { + gowp.Clear(); + } + action(); + if (gowp != null) + { + gowp.OutputStringThreadSafe(outputWriter.ToString()); + gowp.Activate(); + } + statusBar.Progress(ref cookie, 0, "", 0, 0); } -- cgit v1.2.3