diff --git a/Cauldron.Macos/Main.storyboard b/Cauldron.Macos/Main.storyboard
index ff62573..d54b2da 100644
--- a/Cauldron.Macos/Main.storyboard
+++ b/Cauldron.Macos/Main.storyboard
@@ -3,6 +3,7 @@
+
@@ -419,7 +420,7 @@
-
+
@@ -428,7 +429,7 @@
-
+
@@ -444,10 +445,33 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -457,6 +481,7 @@
+
@@ -623,6 +648,9 @@
+
+
+
diff --git a/Cauldron.Macos/MainWindow.cs b/Cauldron.Macos/MainWindow.cs
index eadbecd..0986677 100644
--- a/Cauldron.Macos/MainWindow.cs
+++ b/Cauldron.Macos/MainWindow.cs
@@ -2,6 +2,7 @@ using System;
using System.Collections.Immutable;
using System.Linq;
using System.Threading;
+using System.Threading.Tasks;
using System.Timers;
using AppKit;
using Cauldron.Macos.SourceWriter;
@@ -107,7 +108,19 @@ public partial class MainWindow : NSWindowController
public void UpdateScriptDiagnostics(ImmutableArray diagnostics)
{
- Console.WriteLine(diagnostics.Select(d => $"{d.Severity}: {d.GetMessage()}").Join("\n"));
+ ImmutableList infoDiagnostics = diagnostics
+ .Where(d => d.Severity == DiagnosticSeverity.Info)
+ .ToImmutableList();
+ ImmutableList warningDiagnostics = diagnostics
+ .Where(d => d.Severity == DiagnosticSeverity.Warning)
+ .ToImmutableList();
+ ImmutableList errorDiagnostics = diagnostics
+ .Where(d => d.Severity == DiagnosticSeverity.Error)
+ .ToImmutableList();
+
+ this.DiagnosticsToolbarGroup.SetLabel(infoDiagnostics.Count.ToString(), 0);
+ this.DiagnosticsToolbarGroup.SetLabel(warningDiagnostics.Count.ToString(), 1);
+ this.DiagnosticsToolbarGroup.SetLabel(errorDiagnostics.Count.ToString(), 2);
foreach (Diagnostic diagnostic in diagnostics)
{
diff --git a/Cauldron.Macos/MainWindow.designer.cs b/Cauldron.Macos/MainWindow.designer.cs
index cc048d7..f24b85d 100644
--- a/Cauldron.Macos/MainWindow.designer.cs
+++ b/Cauldron.Macos/MainWindow.designer.cs
@@ -12,6 +12,9 @@ namespace Cauldron.Macos
[Register ("MainWindow")]
partial class MainWindow
{
+ [Outlet]
+ AppKit.NSSegmentedControl DiagnosticsToolbarGroup { get; set; }
+
[Outlet]
AppKit.NSToolbarItem RunScriptToolbarButton { get; set; }
@@ -33,6 +36,11 @@ namespace Cauldron.Macos
RunScriptToolbarButton.Dispose ();
RunScriptToolbarButton = null;
}
+
+ if (DiagnosticsToolbarGroup != null) {
+ DiagnosticsToolbarGroup.Dispose ();
+ DiagnosticsToolbarGroup = null;
+ }
}
}
}
diff --git a/Cauldron.Macos/SourceWriter/SourceTextView.cs b/Cauldron.Macos/SourceWriter/SourceTextView.cs
index 76e9263..40f68c1 100644
--- a/Cauldron.Macos/SourceWriter/SourceTextView.cs
+++ b/Cauldron.Macos/SourceWriter/SourceTextView.cs
@@ -233,6 +233,11 @@ public class SourceTextView : NSTextView
Initialize();
}
+ public SourceTextView(ObjCRuntime.NativeHandle handle) : base(handle)
+ {
+ Initialize();
+ }
+
/// Initialize this instance.
private void Initialize()
{