From 3764628eb33b071e6fafbc2ed9be0ac0d19a3622 Mon Sep 17 00:00:00 2001 From: l0ng-ai <24760907+l0ng-ai@users.noreply.github.com> Date: Thu, 29 Oct 2026 04:47:03 +0800 Subject: [PATCH] fix(debugger): Apply Sort values alphabetically to the frame's locals (#170) The Variables view loads the first scope's locals of the selected frame up front; those ignored the Data Views sort setting, which only applied to children expanded later. --- src/features/debugger/ui/DebugToolWindow.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/features/debugger/ui/DebugToolWindow.tsx b/src/features/debugger/ui/DebugToolWindow.tsx index 7adf6242..89136337 100644 --- a/src/features/debugger/ui/DebugToolWindow.tsx +++ b/src/features/debugger/ui/DebugToolWindow.tsx @@ -40,6 +40,8 @@ import { } from "../state"; import { VariablesView, type VarRoot } from "./VariablesView"; import { pushHistory, readHistory, setConsoleHistoryBrowser } from "./expressionHistory"; +import { sortVariables } from "../values"; +import { workflowSettings } from "@/platform/workflowSettings"; import styles from "./DebugToolWindow.module.css"; import { tx } from "@/platform/i18n"; @@ -389,7 +391,10 @@ function VariablesPane({ session }: { session: DebugSession }) { try { scopes = await call(commands.debugScopes(session.id, frame)); const first = scopes.find((s) => !s.expensive); - if (first) locals = await call(commands.debugVariables(session.id, first.variablesReference)); + if (first) { + const vars = await call(commands.debugVariables(session.id, first.variablesReference)); + locals = workflowSettings().debugger.sortValues ? sortVariables(vars) : vars; + } } catch { // Frame went away (resumed). }