Fix to update the code in the editor before executing (#5976)

* Fix spelling

* Fix to update the code in the editor before executing
This commit is contained in:
Jonathan Tran
2025-03-25 05:06:27 -04:00
committed by GitHub
parent f7f7d9fa2c
commit 58dc3382eb
11 changed files with 192 additions and 134 deletions

View File

@ -3,12 +3,15 @@ import { getFaceDetails } from 'clientSideScene/sceneEntities'
import { deleteFromSelection } from 'lang/modifyAst'
import {
codeManager,
editorManager,
engineCommandManager,
kclManager,
rustContext,
} from 'lib/singletons'
import { err } from 'lib/trap'
import { executeAstMock } from 'lang/langHelpers'
import { updateModelingState } from 'lang/modelingWorkflows'
import { EXECUTION_TYPE_REAL } from 'lib/constants'
export const deletionErrorMessage =
'Unable to delete selection. Please edit manually in code pane.'
@ -36,7 +39,9 @@ export async function deleteSelectionPromise(
if (testExecute.errors.length) {
return new Error(deletionErrorMessage)
}
await kclManager.updateAst(modifiedAst, true)
await codeManager.updateEditorWithAstAndWriteToFile(modifiedAst)
await updateModelingState(modifiedAst, EXECUTION_TYPE_REAL, {
kclManager,
editorManager,
codeManager,
})
}