fix(debugger): Apply Sort values alphabetically to the frame's locals

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.
This commit is contained in:
l0ng-ai
2026-10-29 04:35:09 +08:00
parent 71b7193160
commit d22792d4b0
+6 -1
View File
@@ -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).
}