From e00f1323fc25ca03693c26adbd914874f8d5e524 Mon Sep 17 00:00:00 2001 From: Jonathan Tran Date: Fri, 3 Jan 2025 19:50:52 -0500 Subject: [PATCH] Rename and deprecate orderedCommands --- src/lang/std/artifactGraph.test.ts | 2 +- src/lang/std/engineConnection.ts | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/lang/std/artifactGraph.test.ts b/src/lang/std/artifactGraph.test.ts index 1e38ca2fbc..29271d3ce1 100644 --- a/src/lang/std/artifactGraph.test.ts +++ b/src/lang/std/artifactGraph.test.ts @@ -115,7 +115,7 @@ sketch002 = startSketchOn(offsetPlane001) |> line([6.78, 15.01], %) ` -// add more code snippets here and use `getCommands` to get the orderedCommands and responseMap for more tests +// add more code snippets here and use `getCommands` to get the artifactCommands and responseMap for more tests const codeToWriteCacheFor = { exampleCode1, sketchOnFaceOnFaceEtc, diff --git a/src/lang/std/engineConnection.ts b/src/lang/std/engineConnection.ts index 8332d6736e..463609dc5f 100644 --- a/src/lang/std/engineConnection.ts +++ b/src/lang/std/engineConnection.ts @@ -1306,7 +1306,7 @@ export enum EngineCommandManagerEvents { * * As commands are send their state is tracked in {@link pendingCommands} and clear as soon as we receive a response. * - * Also all commands that are sent are kept track of in {@link orderedCommands} and their responses are kept in {@link responseMap} + * Also all commands that are sent are kept track of in {@link __oldOrderedCommands} and their responses are kept in {@link responseMap} * Both of these data structures are used to process the {@link artifactGraph}. */ @@ -1334,10 +1334,11 @@ export class EngineCommandManager extends EventTarget { /** * The orderedCommands array of all the the commands sent to the engine, un-folded from batches, and made into one long * list of the individual commands, this is used to process all the commands into the artifactGraph + * @deprecated Use artifactCommands returned from the executor instead. */ - orderedCommands: Array = [] + __oldOrderedCommands: Array = [] /** - * A map of the responses to the {@link orderedCommands}, when processing the commands into the artifactGraph, this response map allow + * A map of the responses to the {@link __oldOrderedCommands}, when processing the commands into the artifactGraph, this response map allow * us to look up the response by command id */ responseMap: ResponseMap = {} @@ -1833,7 +1834,7 @@ export class EngineCommandManager extends EventTarget { } } async startNewSession() { - this.orderedCommands = [] + this.__oldOrderedCommands = [] this.responseMap = {} await this.initPlanes() } @@ -2077,7 +2078,7 @@ export class EngineCommandManager extends EventTarget { } if (message.command.type === 'modeling_cmd_req') { - this.orderedCommands.push({ + this.__oldOrderedCommands.push({ command: message.command, range: sourceRangeFromRust(message.range), }) @@ -2092,7 +2093,7 @@ export class EngineCommandManager extends EventTarget { cmd_id: req.cmd_id, cmd: req.cmd, } - this.orderedCommands.push({ + this.__oldOrderedCommands.push({ command: cmd, range, })