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;