diff --git a/UIXC/Commands/CompileCommand.cs b/UIXC/Commands/CompileCommand.cs index 2f38647..fae4b20 100644 --- a/UIXC/Commands/CompileCommand.cs +++ b/UIXC/Commands/CompileCommand.cs @@ -44,18 +44,26 @@ public class CompileCommand : Command { foreach (ErrorRecord error in errors) { - var l = Math.Max(0, error.Line); - var c = Math.Max(0, error.Column); + var l = error.Line; + var c = error.Column; var msg = error.Message; - var ctx = error.Context; + var ctx = error.Context ?? ""; - const string compilerError = "Iris error"; - var diagnostic = error.Warning ? Diagnostic.Warning(compilerError) : Diagnostic.Error(compilerError); + var diagnostic = error.Warning + ? Diagnostic.Warning(msg) + : Diagnostic.Error(msg); - report.AddDiagnostic(diagnostic - .WithCode("UIX0000") - .WithLabel(new(ctx, new Location(l, c), msg)) - ); + if (ctx is not null && error.Line >= 0 && error.Column >= 0) + { + Label label = new(ctx, new Location(l, c), "") + { + Color = error.Warning ? Color.Yellow : Color.Red + }; + + diagnostic = diagnostic.WithLabel(label); + } + + report.AddDiagnostic(diagnostic); } }; TraceSettings.Current.SetCategoryLevel(TraceCategory.Markup, byte.MaxValue); @@ -70,6 +78,8 @@ public class CompileCommand : Command var success = MarkupCompiler.Compile(compilands, dataTableInput); + report.Render(AnsiConsole.Console); + if (!success) { AnsiConsole.MarkupLine("[red]Compilation failed.[/]"); diff --git a/UIXC/Properties/launchSettings.json b/UIXC/Properties/launchSettings.json index aa80970..1fabd2d 100644 --- a/UIXC/Properties/launchSettings.json +++ b/UIXC/Properties/launchSettings.json @@ -1,8 +1,9 @@ { "profiles": { "UIXC": { - "commandName": "Project", - "commandLineArgs": "decompile CONTEXTMENU.UIX --verbose -A UIXControls.dll -I D:\\Documents\\REProj\\Zune\\UIXControls48" + "commandName": "Project", + "commandLineArgs": "compile \"D:\\Documents\\REProj\\Zune\\UIXA\\UIXControls!ComboBox.uixa\" -A ZuneShell.dll -A UIXControls.dll -A ZuneDBApi.dll -o D:\\Documents\\REProj\\Zune\\UIXA", + "workingDirectory": "C:\\Program Files\\Zune" } } } \ No newline at end of file