From 0aaec7e1038fc911606cda764653dcdc1f85792a Mon Sep 17 00:00:00 2001 From: Matt Parker <61717342+MattParkerDev@users.noreply.github.com> Date: Mon, 29 Dec 2025 19:12:12 +1000 Subject: [PATCH] display variable value in red when evaluation failed --- .../Features/CodeEditor/CustomSyntaxHighlighter.cs | 1 + .../SubTabs/ThreadsVariablesSubTab.DebuggerVariableCustomDraw.cs | 1 + 2 files changed, 2 insertions(+) diff --git a/src/SharpIDE.Godot/Features/CodeEditor/CustomSyntaxHighlighter.cs b/src/SharpIDE.Godot/Features/CodeEditor/CustomSyntaxHighlighter.cs index ddccc75..66d5ea6 100644 --- a/src/SharpIDE.Godot/Features/CodeEditor/CustomSyntaxHighlighter.cs +++ b/src/SharpIDE.Godot/Features/CodeEditor/CustomSyntaxHighlighter.cs @@ -304,6 +304,7 @@ public static class CachedColors public static readonly Color VariableBlue = new("9cdcfe"); public static readonly Color Gray = new("a9a9a9"); public static readonly Color Pink = new("c586c0"); + public static readonly Color ErrorRed = new("da5b5a"); public static readonly Color RazorComponentGreen = new("0b7f7f"); public static readonly Color RazorMetaCodePurple = new("a699e6"); diff --git a/src/SharpIDE.Godot/Features/Debug_/Tab/SubTabs/ThreadsVariablesSubTab.DebuggerVariableCustomDraw.cs b/src/SharpIDE.Godot/Features/Debug_/Tab/SubTabs/ThreadsVariablesSubTab.DebuggerVariableCustomDraw.cs index 2ac9170..a3c828b 100644 --- a/src/SharpIDE.Godot/Features/Debug_/Tab/SubTabs/ThreadsVariablesSubTab.DebuggerVariableCustomDraw.cs +++ b/src/SharpIDE.Godot/Features/Debug_/Tab/SubTabs/ThreadsVariablesSubTab.DebuggerVariableCustomDraw.cs @@ -34,6 +34,7 @@ public partial class ThreadsVariablesSubTab var variableValueDisplayColour = variable switch { + _ when variable.PresentationHint?.Attributes is { } attrs && (attrs & VariablePresentationHint.AttributesValue.FailedEvaluation) != 0 => CachedColors.ErrorRed, { Value: "null" } => CachedColors.KeywordBlue, { Value: "true" or "false" } => CachedColors.KeywordBlue, { Type: "string" or "char" } => CachedColors.LightOrangeBrown,