Correct any last missing code mods
This commit is contained in:
@ -849,9 +849,7 @@ export class SceneEntities {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
const newCode = recast(modifiedAst)
|
await codeManager.updateEditorWithAstAndWriteToFile(modifiedAst)
|
||||||
if (err(newCode)) return
|
|
||||||
codeManager.updateCodeEditor(newCode)
|
|
||||||
},
|
},
|
||||||
onMove: (args) => {
|
onMove: (args) => {
|
||||||
this.onDragSegment({
|
this.onDragSegment({
|
||||||
@ -991,6 +989,11 @@ export class SceneEntities {
|
|||||||
await kclManager.executeAstMock(_ast)
|
await kclManager.executeAstMock(_ast)
|
||||||
sceneInfra.modelingSend({ type: 'Finish rectangle' })
|
sceneInfra.modelingSend({ type: 'Finish rectangle' })
|
||||||
|
|
||||||
|
// lee: I had this at the bottom of the function, but it's
|
||||||
|
// possible sketchFromKclValue "fails" when sketching on a face,
|
||||||
|
// and this couldn't wouldn't run.
|
||||||
|
await codeManager.updateEditorWithAstAndWriteToFile(_ast)
|
||||||
|
|
||||||
const { execState } = await executeAst({
|
const { execState } = await executeAst({
|
||||||
ast: _ast,
|
ast: _ast,
|
||||||
useFakeExecutor: true,
|
useFakeExecutor: true,
|
||||||
@ -1016,9 +1019,6 @@ export class SceneEntities {
|
|||||||
sgPaths.forEach((seg, index) =>
|
sgPaths.forEach((seg, index) =>
|
||||||
this.updateSegment(seg, index, 0, _ast, orthoFactor, sketch)
|
this.updateSegment(seg, index, 0, _ast, orthoFactor, sketch)
|
||||||
)
|
)
|
||||||
|
|
||||||
if (err(newCode)) return
|
|
||||||
codeManager.updateCodeEditor(newCode)
|
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -1188,7 +1188,7 @@ export class SceneEntities {
|
|||||||
await kclManager.executeAstMock(_ast)
|
await kclManager.executeAstMock(_ast)
|
||||||
sceneInfra.modelingSend({ type: 'Finish circle' })
|
sceneInfra.modelingSend({ type: 'Finish circle' })
|
||||||
|
|
||||||
codeManager.updateCodeEditor(newCode)
|
await codeManager.updateEditorWithAstAndWriteToFile(_ast)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
@ -733,6 +733,11 @@ export const ModelingMachineProvider = ({
|
|||||||
sketchDetails.origin
|
sketchDetails.origin
|
||||||
)
|
)
|
||||||
if (err(updatedAst)) return Promise.reject(updatedAst)
|
if (err(updatedAst)) return Promise.reject(updatedAst)
|
||||||
|
|
||||||
|
await codeManager.updateEditorWithAstAndWriteToFile(
|
||||||
|
updatedAst.newAst
|
||||||
|
)
|
||||||
|
|
||||||
const selection = updateSelections(
|
const selection = updateSelections(
|
||||||
pathToNodeMap,
|
pathToNodeMap,
|
||||||
selectionRanges,
|
selectionRanges,
|
||||||
@ -769,6 +774,11 @@ export const ModelingMachineProvider = ({
|
|||||||
sketchDetails.origin
|
sketchDetails.origin
|
||||||
)
|
)
|
||||||
if (err(updatedAst)) return Promise.reject(updatedAst)
|
if (err(updatedAst)) return Promise.reject(updatedAst)
|
||||||
|
|
||||||
|
await codeManager.updateEditorWithAstAndWriteToFile(
|
||||||
|
updatedAst.newAst
|
||||||
|
)
|
||||||
|
|
||||||
const selection = updateSelections(
|
const selection = updateSelections(
|
||||||
pathToNodeMap,
|
pathToNodeMap,
|
||||||
selectionRanges,
|
selectionRanges,
|
||||||
@ -814,6 +824,11 @@ export const ModelingMachineProvider = ({
|
|||||||
sketchDetails.origin
|
sketchDetails.origin
|
||||||
)
|
)
|
||||||
if (err(updatedAst)) return Promise.reject(updatedAst)
|
if (err(updatedAst)) return Promise.reject(updatedAst)
|
||||||
|
|
||||||
|
await codeManager.updateEditorWithAstAndWriteToFile(
|
||||||
|
updatedAst.newAst
|
||||||
|
)
|
||||||
|
|
||||||
const selection = updateSelections(
|
const selection = updateSelections(
|
||||||
pathToNodeMap,
|
pathToNodeMap,
|
||||||
selectionRanges,
|
selectionRanges,
|
||||||
@ -847,6 +862,11 @@ export const ModelingMachineProvider = ({
|
|||||||
sketchDetails.origin
|
sketchDetails.origin
|
||||||
)
|
)
|
||||||
if (err(updatedAst)) return Promise.reject(updatedAst)
|
if (err(updatedAst)) return Promise.reject(updatedAst)
|
||||||
|
|
||||||
|
await codeManager.updateEditorWithAstAndWriteToFile(
|
||||||
|
updatedAst.newAst
|
||||||
|
)
|
||||||
|
|
||||||
const selection = updateSelections(
|
const selection = updateSelections(
|
||||||
pathToNodeMap,
|
pathToNodeMap,
|
||||||
selectionRanges,
|
selectionRanges,
|
||||||
@ -882,6 +902,11 @@ export const ModelingMachineProvider = ({
|
|||||||
sketchDetails.origin
|
sketchDetails.origin
|
||||||
)
|
)
|
||||||
if (err(updatedAst)) return Promise.reject(updatedAst)
|
if (err(updatedAst)) return Promise.reject(updatedAst)
|
||||||
|
|
||||||
|
await codeManager.updateEditorWithAstAndWriteToFile(
|
||||||
|
updatedAst.newAst
|
||||||
|
)
|
||||||
|
|
||||||
const selection = updateSelections(
|
const selection = updateSelections(
|
||||||
pathToNodeMap,
|
pathToNodeMap,
|
||||||
selectionRanges,
|
selectionRanges,
|
||||||
@ -918,6 +943,11 @@ export const ModelingMachineProvider = ({
|
|||||||
sketchDetails.origin
|
sketchDetails.origin
|
||||||
)
|
)
|
||||||
if (err(updatedAst)) return Promise.reject(updatedAst)
|
if (err(updatedAst)) return Promise.reject(updatedAst)
|
||||||
|
|
||||||
|
await codeManager.updateEditorWithAstAndWriteToFile(
|
||||||
|
updatedAst.newAst
|
||||||
|
)
|
||||||
|
|
||||||
const selection = updateSelections(
|
const selection = updateSelections(
|
||||||
pathToNodeMap,
|
pathToNodeMap,
|
||||||
selectionRanges,
|
selectionRanges,
|
||||||
@ -954,6 +984,11 @@ export const ModelingMachineProvider = ({
|
|||||||
sketchDetails.origin
|
sketchDetails.origin
|
||||||
)
|
)
|
||||||
if (err(updatedAst)) return Promise.reject(updatedAst)
|
if (err(updatedAst)) return Promise.reject(updatedAst)
|
||||||
|
|
||||||
|
await codeManager.updateEditorWithAstAndWriteToFile(
|
||||||
|
updatedAst.newAst
|
||||||
|
)
|
||||||
|
|
||||||
const selection = updateSelections(
|
const selection = updateSelections(
|
||||||
pathToNodeMap,
|
pathToNodeMap,
|
||||||
selectionRanges,
|
selectionRanges,
|
||||||
@ -1000,6 +1035,11 @@ export const ModelingMachineProvider = ({
|
|||||||
sketchDetails.origin
|
sketchDetails.origin
|
||||||
)
|
)
|
||||||
if (err(updatedAst)) return Promise.reject(updatedAst)
|
if (err(updatedAst)) return Promise.reject(updatedAst)
|
||||||
|
|
||||||
|
await codeManager.updateEditorWithAstAndWriteToFile(
|
||||||
|
updatedAst.newAst
|
||||||
|
)
|
||||||
|
|
||||||
const selection = updateSelections(
|
const selection = updateSelections(
|
||||||
{ 0: pathToReplacedNode },
|
{ 0: pathToReplacedNode },
|
||||||
selectionRanges,
|
selectionRanges,
|
||||||
|
@ -7,6 +7,8 @@ import toast from 'react-hot-toast'
|
|||||||
import { editorManager } from 'lib/singletons'
|
import { editorManager } from 'lib/singletons'
|
||||||
import { Annotation, Transaction } from '@codemirror/state'
|
import { Annotation, Transaction } from '@codemirror/state'
|
||||||
import { KeyBinding } from '@codemirror/view'
|
import { KeyBinding } from '@codemirror/view'
|
||||||
|
import { recast, Program } from 'lang/wasm'
|
||||||
|
import { err } from 'lib/trap'
|
||||||
|
|
||||||
const PERSIST_CODE_KEY = 'persistCode'
|
const PERSIST_CODE_KEY = 'persistCode'
|
||||||
|
|
||||||
@ -147,6 +149,13 @@ export default class CodeManager {
|
|||||||
safeLSSetItem(PERSIST_CODE_KEY, this.code)
|
safeLSSetItem(PERSIST_CODE_KEY, this.code)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async updateEditorWithAstAndWriteToFile(ast: Program) {
|
||||||
|
const newCode = recast(ast)
|
||||||
|
if (err(newCode)) return
|
||||||
|
this.updateCodeStateEditor(newCode)
|
||||||
|
await this.writeToFile()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function safeLSGetItem(key: string) {
|
function safeLSGetItem(key: string) {
|
||||||
|
@ -513,15 +513,6 @@ export const modelingMachine = setup({
|
|||||||
},
|
},
|
||||||
// end guards
|
// end guards
|
||||||
actions: {
|
actions: {
|
||||||
'code editor process changes': ({ event, context }) => {
|
|
||||||
;(async () => {
|
|
||||||
const newCode = recast(kclManager.ast)
|
|
||||||
if (err(newCode)) return
|
|
||||||
await codeManager.updateCodeStateEditor(newCode)
|
|
||||||
|
|
||||||
await codeManager.writeToFile()
|
|
||||||
})().catch(reportRejection)
|
|
||||||
},
|
|
||||||
'assign tool in context': assign({
|
'assign tool in context': assign({
|
||||||
currentTool: ({ event }) =>
|
currentTool: ({ event }) =>
|
||||||
'data' in event && event.data && 'tool' in event.data
|
'data' in event && event.data && 'tool' in event.data
|
||||||
@ -541,29 +532,25 @@ export const modelingMachine = setup({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
// eslint-disable-next-line @typescript-eslint/no-misused-promises
|
'hide default planes': () => {
|
||||||
'hide default planes': () => kclManager.hidePlanes(),
|
void kclManager.hidePlanes()
|
||||||
|
},
|
||||||
'reset sketch metadata': assign({
|
'reset sketch metadata': assign({
|
||||||
sketchDetails: null,
|
sketchDetails: null,
|
||||||
sketchEnginePathId: '',
|
sketchEnginePathId: '',
|
||||||
sketchPlaneId: '',
|
sketchPlaneId: '',
|
||||||
}),
|
}),
|
||||||
'reset camera position': () => {
|
'reset camera position': () => {
|
||||||
;(async () => {
|
void engineCommandManager.sendSceneCommand({
|
||||||
await engineCommandManager.sendSceneCommand({
|
type: 'modeling_cmd_req',
|
||||||
type: 'modeling_cmd_req',
|
cmd_id: uuidv4(),
|
||||||
cmd_id: uuidv4(),
|
cmd: {
|
||||||
cmd: {
|
type: 'default_camera_look_at',
|
||||||
type: 'default_camera_look_at',
|
center: { x: 0, y: 0, z: 0 },
|
||||||
center: { x: 0, y: 0, z: 0 },
|
vantage: { x: 0, y: -1250, z: 580 },
|
||||||
vantage: { x: 0, y: -1250, z: 580 },
|
up: { x: 0, y: 0, z: 1 },
|
||||||
up: { x: 0, y: 0, z: 1 },
|
},
|
||||||
},
|
})
|
||||||
})
|
|
||||||
await sceneInfra.camControls.centerModelRelativeToPanes({
|
|
||||||
resetLastPaneWidth: true,
|
|
||||||
})
|
|
||||||
})().catch(reportRejection)
|
|
||||||
},
|
},
|
||||||
'set new sketch metadata': assign(({ event }) => {
|
'set new sketch metadata': assign(({ event }) => {
|
||||||
if (
|
if (
|
||||||
@ -618,9 +605,7 @@ export const modelingMachine = setup({
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
const newCode = recast(updatedAst.newAst)
|
await codeManager.updateEditorWithAstAndWriteToFile(updatedAst.newAst)
|
||||||
if (err(newCode)) return
|
|
||||||
await codeManager.updateCodeEditor(newCode)
|
|
||||||
|
|
||||||
if (updatedAst?.selections) {
|
if (updatedAst?.selections) {
|
||||||
editorManager.selectRange(updatedAst?.selections)
|
editorManager.selectRange(updatedAst?.selections)
|
||||||
@ -664,9 +649,7 @@ export const modelingMachine = setup({
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
const newCode = recast(updatedAst.newAst)
|
await codeManager.updateEditorWithAstAndWriteToFile(updatedAst.newAst)
|
||||||
if (err(newCode)) return
|
|
||||||
await codeManager.updateCodeEditor(newCode)
|
|
||||||
|
|
||||||
if (updatedAst?.selections) {
|
if (updatedAst?.selections) {
|
||||||
editorManager.selectRange(updatedAst?.selections)
|
editorManager.selectRange(updatedAst?.selections)
|
||||||
@ -697,10 +680,7 @@ export const modelingMachine = setup({
|
|||||||
}
|
}
|
||||||
|
|
||||||
await kclManager.updateAst(modifiedAst, true)
|
await kclManager.updateAst(modifiedAst, true)
|
||||||
|
await codeManager.updateEditorWithAstAndWriteToFile(modifiedAst)
|
||||||
const newCode = recast(modifiedAst)
|
|
||||||
if (err(newCode)) return
|
|
||||||
await codeManager.updateCodeEditor(newCode)
|
|
||||||
})().catch(reportRejection)
|
})().catch(reportRejection)
|
||||||
},
|
},
|
||||||
'AST fillet': ({ event }) => {
|
'AST fillet': ({ event }) => {
|
||||||
@ -718,6 +698,9 @@ export const modelingMachine = setup({
|
|||||||
radius
|
radius
|
||||||
)
|
)
|
||||||
if (err(applyFilletToSelectionResult)) return applyFilletToSelectionResult
|
if (err(applyFilletToSelectionResult)) return applyFilletToSelectionResult
|
||||||
|
|
||||||
|
console.log(applyFilletToSelectionResult)
|
||||||
|
void codeManager.updateEditorWithAstAndWriteToFile(kclManager.ast)
|
||||||
},
|
},
|
||||||
'set selection filter to curves only': () => {
|
'set selection filter to curves only': () => {
|
||||||
;(async () => {
|
;(async () => {
|
||||||
@ -774,25 +757,32 @@ export const modelingMachine = setup({
|
|||||||
'remove sketch grid': () => sceneEntitiesManager.removeSketchGrid(),
|
'remove sketch grid': () => sceneEntitiesManager.removeSketchGrid(),
|
||||||
'set up draft line': ({ context: { sketchDetails } }) => {
|
'set up draft line': ({ context: { sketchDetails } }) => {
|
||||||
if (!sketchDetails) return
|
if (!sketchDetails) return
|
||||||
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
||||||
sceneEntitiesManager.setupDraftSegment(
|
void sceneEntitiesManager
|
||||||
sketchDetails.sketchPathToNode,
|
.setupDraftSegment(
|
||||||
sketchDetails.zAxis,
|
sketchDetails.sketchPathToNode,
|
||||||
sketchDetails.yAxis,
|
sketchDetails.zAxis,
|
||||||
sketchDetails.origin,
|
sketchDetails.yAxis,
|
||||||
'line'
|
sketchDetails.origin,
|
||||||
)
|
'line'
|
||||||
|
)
|
||||||
|
.then(() => {
|
||||||
|
return codeManager.updateEditorWithAstAndWriteToFile(kclManager.ast)
|
||||||
|
})
|
||||||
},
|
},
|
||||||
'set up draft arc': ({ context: { sketchDetails } }) => {
|
'set up draft arc': ({ context: { sketchDetails } }) => {
|
||||||
if (!sketchDetails) return
|
if (!sketchDetails) return
|
||||||
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
void sceneEntitiesManager
|
||||||
sceneEntitiesManager.setupDraftSegment(
|
.setupDraftSegment(
|
||||||
sketchDetails.sketchPathToNode,
|
sketchDetails.sketchPathToNode,
|
||||||
sketchDetails.zAxis,
|
sketchDetails.zAxis,
|
||||||
sketchDetails.yAxis,
|
sketchDetails.yAxis,
|
||||||
sketchDetails.origin,
|
sketchDetails.origin,
|
||||||
'tangentialArcTo'
|
'tangentialArcTo'
|
||||||
)
|
)
|
||||||
|
.then(() => {
|
||||||
|
return codeManager.updateEditorWithAstAndWriteToFile(kclManager.ast)
|
||||||
|
})
|
||||||
},
|
},
|
||||||
'listen for rectangle origin': ({ context: { sketchDetails } }) => {
|
'listen for rectangle origin': ({ context: { sketchDetails } }) => {
|
||||||
if (!sketchDetails) return
|
if (!sketchDetails) return
|
||||||
@ -850,38 +840,49 @@ export const modelingMachine = setup({
|
|||||||
'set up draft rectangle': ({ context: { sketchDetails }, event }) => {
|
'set up draft rectangle': ({ context: { sketchDetails }, event }) => {
|
||||||
if (event.type !== 'Add rectangle origin') return
|
if (event.type !== 'Add rectangle origin') return
|
||||||
if (!sketchDetails || !event.data) return
|
if (!sketchDetails || !event.data) return
|
||||||
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
||||||
sceneEntitiesManager.setupDraftRectangle(
|
void sceneEntitiesManager
|
||||||
sketchDetails.sketchPathToNode,
|
.setupDraftRectangle(
|
||||||
sketchDetails.zAxis,
|
sketchDetails.sketchPathToNode,
|
||||||
sketchDetails.yAxis,
|
sketchDetails.zAxis,
|
||||||
sketchDetails.origin,
|
sketchDetails.yAxis,
|
||||||
event.data
|
sketchDetails.origin,
|
||||||
)
|
event.data
|
||||||
|
)
|
||||||
|
.then(() => {
|
||||||
|
return codeManager.updateEditorWithAstAndWriteToFile(kclManager.ast)
|
||||||
|
})
|
||||||
},
|
},
|
||||||
'set up draft circle': ({ context: { sketchDetails }, event }) => {
|
'set up draft circle': ({ context: { sketchDetails }, event }) => {
|
||||||
if (event.type !== 'Add circle origin') return
|
if (event.type !== 'Add circle origin') return
|
||||||
if (!sketchDetails || !event.data) return
|
if (!sketchDetails || !event.data) return
|
||||||
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
||||||
sceneEntitiesManager.setupDraftCircle(
|
void sceneEntitiesManager
|
||||||
sketchDetails.sketchPathToNode,
|
.setupDraftCircle(
|
||||||
sketchDetails.zAxis,
|
sketchDetails.sketchPathToNode,
|
||||||
sketchDetails.yAxis,
|
sketchDetails.zAxis,
|
||||||
sketchDetails.origin,
|
sketchDetails.yAxis,
|
||||||
event.data
|
sketchDetails.origin,
|
||||||
)
|
event.data
|
||||||
|
)
|
||||||
|
.then(() => {
|
||||||
|
return codeManager.updateEditorWithAstAndWriteToFile(kclManager.ast)
|
||||||
|
})
|
||||||
},
|
},
|
||||||
'set up draft line without teardown': ({ context: { sketchDetails } }) => {
|
'set up draft line without teardown': ({ context: { sketchDetails } }) => {
|
||||||
if (!sketchDetails) return
|
if (!sketchDetails) return
|
||||||
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
void sceneEntitiesManager
|
||||||
sceneEntitiesManager.setupDraftSegment(
|
.setupDraftSegment(
|
||||||
sketchDetails.sketchPathToNode,
|
sketchDetails.sketchPathToNode,
|
||||||
sketchDetails.zAxis,
|
sketchDetails.zAxis,
|
||||||
sketchDetails.yAxis,
|
sketchDetails.yAxis,
|
||||||
sketchDetails.origin,
|
sketchDetails.origin,
|
||||||
'line',
|
'line',
|
||||||
false
|
false
|
||||||
)
|
)
|
||||||
|
.then(() => {
|
||||||
|
return codeManager.updateEditorWithAstAndWriteToFile(kclManager.ast)
|
||||||
|
})
|
||||||
},
|
},
|
||||||
'show default planes': () => {
|
'show default planes': () => {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
||||||
@ -898,12 +899,14 @@ export const modelingMachine = setup({
|
|||||||
'add axis n grid': ({ context: { sketchDetails } }) => {
|
'add axis n grid': ({ context: { sketchDetails } }) => {
|
||||||
if (!sketchDetails) return
|
if (!sketchDetails) return
|
||||||
if (localStorage.getItem('disableAxis')) return
|
if (localStorage.getItem('disableAxis')) return
|
||||||
sceneEntitiesManager.createSketchAxis(
|
void sceneEntitiesManager.createSketchAxis(
|
||||||
sketchDetails.sketchPathToNode || [],
|
sketchDetails.sketchPathToNode || [],
|
||||||
sketchDetails.zAxis,
|
sketchDetails.zAxis,
|
||||||
sketchDetails.yAxis,
|
sketchDetails.yAxis,
|
||||||
sketchDetails.origin
|
sketchDetails.origin
|
||||||
)
|
)
|
||||||
|
|
||||||
|
void codeManager.updateEditorWithAstAndWriteToFile(kclManager.ast)
|
||||||
},
|
},
|
||||||
'reset client scene mouse handlers': () => {
|
'reset client scene mouse handlers': () => {
|
||||||
// when not in sketch mode we don't need any mouse listeners
|
// when not in sketch mode we don't need any mouse listeners
|
||||||
@ -932,10 +935,12 @@ export const modelingMachine = setup({
|
|||||||
'Delete segment': ({ context: { sketchDetails }, event }) => {
|
'Delete segment': ({ context: { sketchDetails }, event }) => {
|
||||||
if (event.type !== 'Delete segment') return
|
if (event.type !== 'Delete segment') return
|
||||||
if (!sketchDetails || !event.data) return
|
if (!sketchDetails || !event.data) return
|
||||||
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
||||||
deleteSegment({
|
void deleteSegment({
|
||||||
pathToNode: event.data,
|
pathToNode: event.data,
|
||||||
sketchDetails,
|
sketchDetails,
|
||||||
|
}).then(() => {
|
||||||
|
return codeManager.updateEditorWithAstAndWriteToFile(kclManager.ast)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
'Reset Segment Overlays': () => sceneEntitiesManager.resetOverlays(),
|
'Reset Segment Overlays': () => sceneEntitiesManager.resetOverlays(),
|
||||||
@ -1000,6 +1005,9 @@ export const modelingMachine = setup({
|
|||||||
)
|
)
|
||||||
if (trap(updatedAst, { suppress: true })) return
|
if (trap(updatedAst, { suppress: true })) return
|
||||||
if (!updatedAst) return
|
if (!updatedAst) return
|
||||||
|
|
||||||
|
await codeManager.updateEditorWithAstAndWriteToFile(updatedAst.newAst)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
selectionType: 'completeSelection',
|
selectionType: 'completeSelection',
|
||||||
selection: updateSelections(
|
selection: updateSelections(
|
||||||
@ -1034,6 +1042,7 @@ export const modelingMachine = setup({
|
|||||||
)
|
)
|
||||||
if (trap(updatedAst, { suppress: true })) return
|
if (trap(updatedAst, { suppress: true })) return
|
||||||
if (!updatedAst) return
|
if (!updatedAst) return
|
||||||
|
await codeManager.updateEditorWithAstAndWriteToFile(updatedAst.newAst)
|
||||||
return {
|
return {
|
||||||
selectionType: 'completeSelection',
|
selectionType: 'completeSelection',
|
||||||
selection: updateSelections(
|
selection: updateSelections(
|
||||||
@ -1068,6 +1077,7 @@ export const modelingMachine = setup({
|
|||||||
)
|
)
|
||||||
if (trap(updatedAst, { suppress: true })) return
|
if (trap(updatedAst, { suppress: true })) return
|
||||||
if (!updatedAst) return
|
if (!updatedAst) return
|
||||||
|
await codeManager.updateEditorWithAstAndWriteToFile(updatedAst.newAst)
|
||||||
return {
|
return {
|
||||||
selectionType: 'completeSelection',
|
selectionType: 'completeSelection',
|
||||||
selection: updateSelections(
|
selection: updateSelections(
|
||||||
@ -1100,6 +1110,7 @@ export const modelingMachine = setup({
|
|||||||
)
|
)
|
||||||
if (trap(updatedAst, { suppress: true })) return
|
if (trap(updatedAst, { suppress: true })) return
|
||||||
if (!updatedAst) return
|
if (!updatedAst) return
|
||||||
|
await codeManager.updateEditorWithAstAndWriteToFile(updatedAst.newAst)
|
||||||
const updatedSelectionRanges = updateSelections(
|
const updatedSelectionRanges = updateSelections(
|
||||||
pathToNodeMap,
|
pathToNodeMap,
|
||||||
selectionRanges,
|
selectionRanges,
|
||||||
@ -1133,6 +1144,7 @@ export const modelingMachine = setup({
|
|||||||
)
|
)
|
||||||
if (trap(updatedAst, { suppress: true })) return
|
if (trap(updatedAst, { suppress: true })) return
|
||||||
if (!updatedAst) return
|
if (!updatedAst) return
|
||||||
|
await codeManager.updateEditorWithAstAndWriteToFile(updatedAst.newAst)
|
||||||
const updatedSelectionRanges = updateSelections(
|
const updatedSelectionRanges = updateSelections(
|
||||||
pathToNodeMap,
|
pathToNodeMap,
|
||||||
selectionRanges,
|
selectionRanges,
|
||||||
@ -1166,6 +1178,7 @@ export const modelingMachine = setup({
|
|||||||
)
|
)
|
||||||
if (trap(updatedAst, { suppress: true })) return
|
if (trap(updatedAst, { suppress: true })) return
|
||||||
if (!updatedAst) return
|
if (!updatedAst) return
|
||||||
|
await codeManager.updateEditorWithAstAndWriteToFile(updatedAst.newAst)
|
||||||
const updatedSelectionRanges = updateSelections(
|
const updatedSelectionRanges = updateSelections(
|
||||||
pathToNodeMap,
|
pathToNodeMap,
|
||||||
selectionRanges,
|
selectionRanges,
|
||||||
@ -1199,6 +1212,7 @@ export const modelingMachine = setup({
|
|||||||
)
|
)
|
||||||
if (trap(updatedAst, { suppress: true })) return
|
if (trap(updatedAst, { suppress: true })) return
|
||||||
if (!updatedAst) return
|
if (!updatedAst) return
|
||||||
|
await codeManager.updateEditorWithAstAndWriteToFile(updatedAst.newAst)
|
||||||
const updatedSelectionRanges = updateSelections(
|
const updatedSelectionRanges = updateSelections(
|
||||||
pathToNodeMap,
|
pathToNodeMap,
|
||||||
selectionRanges,
|
selectionRanges,
|
||||||
@ -1236,6 +1250,8 @@ export const modelingMachine = setup({
|
|||||||
)
|
)
|
||||||
if (trap(updatedAst, { suppress: true })) return
|
if (trap(updatedAst, { suppress: true })) return
|
||||||
if (!updatedAst) return
|
if (!updatedAst) return
|
||||||
|
await codeManager.updateEditorWithAstAndWriteToFile(updatedAst.newAst)
|
||||||
|
|
||||||
const updatedSelectionRanges = updateSelections(
|
const updatedSelectionRanges = updateSelections(
|
||||||
pathToNodeMap,
|
pathToNodeMap,
|
||||||
selectionRanges,
|
selectionRanges,
|
||||||
@ -1268,6 +1284,7 @@ export const modelingMachine = setup({
|
|||||||
)
|
)
|
||||||
if (trap(updatedAst, { suppress: true })) return
|
if (trap(updatedAst, { suppress: true })) return
|
||||||
if (!updatedAst) return
|
if (!updatedAst) return
|
||||||
|
await codeManager.updateEditorWithAstAndWriteToFile(updatedAst.newAst)
|
||||||
const updatedSelectionRanges = updateSelections(
|
const updatedSelectionRanges = updateSelections(
|
||||||
pathToNodeMap,
|
pathToNodeMap,
|
||||||
selectionRanges,
|
selectionRanges,
|
||||||
@ -1572,11 +1589,7 @@ export const modelingMachine = setup({
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
entry: [
|
entry: ['setup client side sketch segments'],
|
||||||
'setup client side sketch segments',
|
|
||||||
|
|
||||||
'code editor process changes',
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
|
|
||||||
'Await horizontal distance info': {
|
'Await horizontal distance info': {
|
||||||
@ -1589,7 +1602,7 @@ export const modelingMachine = setup({
|
|||||||
}),
|
}),
|
||||||
onDone: {
|
onDone: {
|
||||||
target: 'SketchIdle',
|
target: 'SketchIdle',
|
||||||
actions: ['code editor process changes', 'Set selection'],
|
actions: 'Set selection',
|
||||||
},
|
},
|
||||||
onError: 'SketchIdle',
|
onError: 'SketchIdle',
|
||||||
},
|
},
|
||||||
@ -1605,7 +1618,7 @@ export const modelingMachine = setup({
|
|||||||
}),
|
}),
|
||||||
onDone: {
|
onDone: {
|
||||||
target: 'SketchIdle',
|
target: 'SketchIdle',
|
||||||
actions: ['code editor process changes', 'Set selection'],
|
actions: 'Set selection',
|
||||||
},
|
},
|
||||||
onError: 'SketchIdle',
|
onError: 'SketchIdle',
|
||||||
},
|
},
|
||||||
@ -1621,7 +1634,7 @@ export const modelingMachine = setup({
|
|||||||
}),
|
}),
|
||||||
onDone: {
|
onDone: {
|
||||||
target: 'SketchIdle',
|
target: 'SketchIdle',
|
||||||
actions: ['code editor process changes', 'Set selection'],
|
actions: 'Set selection',
|
||||||
},
|
},
|
||||||
onError: 'SketchIdle',
|
onError: 'SketchIdle',
|
||||||
},
|
},
|
||||||
@ -1637,7 +1650,7 @@ export const modelingMachine = setup({
|
|||||||
}),
|
}),
|
||||||
onDone: {
|
onDone: {
|
||||||
target: 'SketchIdle',
|
target: 'SketchIdle',
|
||||||
actions: ['code editor process changes', 'Set selection'],
|
actions: 'Set selection',
|
||||||
},
|
},
|
||||||
onError: 'SketchIdle',
|
onError: 'SketchIdle',
|
||||||
},
|
},
|
||||||
@ -1653,7 +1666,7 @@ export const modelingMachine = setup({
|
|||||||
}),
|
}),
|
||||||
onDone: {
|
onDone: {
|
||||||
target: 'SketchIdle',
|
target: 'SketchIdle',
|
||||||
actions: ['code editor process changes', 'Set selection'],
|
actions: 'Set selection',
|
||||||
},
|
},
|
||||||
onError: 'SketchIdle',
|
onError: 'SketchIdle',
|
||||||
},
|
},
|
||||||
@ -1669,7 +1682,7 @@ export const modelingMachine = setup({
|
|||||||
}),
|
}),
|
||||||
onDone: {
|
onDone: {
|
||||||
target: 'SketchIdle',
|
target: 'SketchIdle',
|
||||||
actions: ['code editor process changes', 'Set selection'],
|
actions: 'Set selection',
|
||||||
},
|
},
|
||||||
onError: 'SketchIdle',
|
onError: 'SketchIdle',
|
||||||
},
|
},
|
||||||
@ -1685,7 +1698,7 @@ export const modelingMachine = setup({
|
|||||||
}),
|
}),
|
||||||
onDone: {
|
onDone: {
|
||||||
target: 'SketchIdle',
|
target: 'SketchIdle',
|
||||||
actions: ['code editor process changes', 'Set selection'],
|
actions: 'Set selection',
|
||||||
},
|
},
|
||||||
onError: 'SketchIdle',
|
onError: 'SketchIdle',
|
||||||
},
|
},
|
||||||
@ -1821,7 +1834,7 @@ export const modelingMachine = setup({
|
|||||||
onError: 'SketchIdle',
|
onError: 'SketchIdle',
|
||||||
onDone: {
|
onDone: {
|
||||||
target: 'SketchIdle',
|
target: 'SketchIdle',
|
||||||
actions: ['code editor process changes', 'Set selection'],
|
actions: 'Set selection',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -1842,7 +1855,7 @@ export const modelingMachine = setup({
|
|||||||
},
|
},
|
||||||
onDone: {
|
onDone: {
|
||||||
target: 'SketchIdle',
|
target: 'SketchIdle',
|
||||||
actions: ['code editor process changes', 'Set selection'],
|
actions: 'Set selection',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -1857,7 +1870,7 @@ export const modelingMachine = setup({
|
|||||||
}),
|
}),
|
||||||
onDone: {
|
onDone: {
|
||||||
target: 'SketchIdle',
|
target: 'SketchIdle',
|
||||||
actions: ['code editor process changes', 'Set selection'],
|
actions: 'Set selection',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -1872,7 +1885,7 @@ export const modelingMachine = setup({
|
|||||||
}),
|
}),
|
||||||
onDone: {
|
onDone: {
|
||||||
target: 'SketchIdle',
|
target: 'SketchIdle',
|
||||||
actions: ['code editor process changes', 'Set selection'],
|
actions: 'Set selection',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -1887,7 +1900,7 @@ export const modelingMachine = setup({
|
|||||||
}),
|
}),
|
||||||
onDone: {
|
onDone: {
|
||||||
target: 'SketchIdle',
|
target: 'SketchIdle',
|
||||||
actions: ['code editor process changes', 'Set selection'],
|
actions: 'Set selection',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -1902,7 +1915,7 @@ export const modelingMachine = setup({
|
|||||||
}),
|
}),
|
||||||
onDone: {
|
onDone: {
|
||||||
target: 'SketchIdle',
|
target: 'SketchIdle',
|
||||||
actions: ['code editor process changes', 'Set selection'],
|
actions: 'Set selection',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -1917,7 +1930,7 @@ export const modelingMachine = setup({
|
|||||||
}),
|
}),
|
||||||
onDone: {
|
onDone: {
|
||||||
target: 'SketchIdle',
|
target: 'SketchIdle',
|
||||||
actions: ['code editor process changes', 'Set selection'],
|
actions: 'Set selection',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -1932,7 +1945,7 @@ export const modelingMachine = setup({
|
|||||||
}),
|
}),
|
||||||
onDone: {
|
onDone: {
|
||||||
target: 'SketchIdle',
|
target: 'SketchIdle',
|
||||||
actions: ['code editor process changes', 'Set selection'],
|
actions: 'Set selection',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -1947,7 +1960,7 @@ export const modelingMachine = setup({
|
|||||||
}),
|
}),
|
||||||
onDone: {
|
onDone: {
|
||||||
target: 'SketchIdle',
|
target: 'SketchIdle',
|
||||||
actions: ['code editor process changes', 'Set selection'],
|
actions: 'Set selection',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -1962,7 +1975,7 @@ export const modelingMachine = setup({
|
|||||||
}),
|
}),
|
||||||
onDone: {
|
onDone: {
|
||||||
target: 'SketchIdle',
|
target: 'SketchIdle',
|
||||||
actions: ['code editor process changes', 'Set selection'],
|
actions: 'Set selection',
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user