From a86ef417a93e2fb0c6f7dd7e2b53c23d1d751ec3 Mon Sep 17 00:00:00 2001 From: Liviu Seniuc Date: Fri, 15 Dec 2023 00:18:29 +0100 Subject: [PATCH] feat: provide diagnostics to StudioWeb --- src/UiPath.Workflow/Activities/ScriptingAotCompiler.cs | 3 ++- .../XamlIntegration/TextExpressionCompilerError.cs | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/UiPath.Workflow/Activities/ScriptingAotCompiler.cs b/src/UiPath.Workflow/Activities/ScriptingAotCompiler.cs index 45ef79eb..1c8f8cb5 100644 --- a/src/UiPath.Workflow/Activities/ScriptingAotCompiler.cs +++ b/src/UiPath.Workflow/Activities/ScriptingAotCompiler.cs @@ -85,7 +85,8 @@ private static void AddDiagnostics(TextExpressionCompilerResults results, IEnume SourceLineNumber = diagnostic.Location.GetMappedLineSpan().StartLinePosition.Line, Number = diagnostic.Id, Message = diagnostic.ToString(), - IsWarning = diagnostic.Severity < DiagnosticSeverity.Error + IsWarning = diagnostic.Severity < DiagnosticSeverity.Error, + Diagnostic = diagnostic // used by Studio Web through reflection })); } diff --git a/src/UiPath.Workflow/XamlIntegration/TextExpressionCompilerError.cs b/src/UiPath.Workflow/XamlIntegration/TextExpressionCompilerError.cs index 95504dff..3623d9b4 100644 --- a/src/UiPath.Workflow/XamlIntegration/TextExpressionCompilerError.cs +++ b/src/UiPath.Workflow/XamlIntegration/TextExpressionCompilerError.cs @@ -1,6 +1,8 @@ // This file is part of Core WF which is licensed under the MIT license. // See LICENSE file in the project root for full license information. +using Microsoft.CodeAnalysis; + namespace System.Activities.XamlIntegration; [Serializable] @@ -16,6 +18,10 @@ internal TextExpressionCompilerError() { } public string Number { get; internal set; } + // To be used with reflection in Studio Web + // marked as internal so it's not referenced in wrong places + internal Diagnostic Diagnostic { get; set; } + public override string ToString() { return Message;