Skip to content

Commit

Permalink
Rename and deprecate orderedCommands
Browse files Browse the repository at this point in the history
  • Loading branch information
jtran committed Jan 4, 2025
1 parent 622acc0 commit e00f132
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/lang/std/artifactGraph.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
13 changes: 7 additions & 6 deletions src/lang/std/engineConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}.
*/

Expand Down Expand Up @@ -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<OrderedCommand> = []
__oldOrderedCommands: Array<OrderedCommand> = []
/**
* 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 = {}
Expand Down Expand Up @@ -1833,7 +1834,7 @@ export class EngineCommandManager extends EventTarget {
}
}
async startNewSession() {
this.orderedCommands = []
this.__oldOrderedCommands = []
this.responseMap = {}
await this.initPlanes()
}
Expand Down Expand Up @@ -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),
})
Expand All @@ -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,
})
Expand Down

0 comments on commit e00f132

Please sign in to comment.