display variable value in red when evaluation failed

This commit is contained in:
Matt Parker
2025-12-29 19:12:12 +10:00
parent e5ad45d949
commit 0aaec7e103
2 changed files with 2 additions and 0 deletions

View File

@@ -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");

View File

@@ -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,