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:
@ -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,
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user