Allow deletion of only item in AST (#6335)

* Update test to check for deletion of only operation

* Allow updateEditorWithAstAndWriteToFile to clear AST

* Update src/lang/codeManager.ts

Co-authored-by: Jonathan Tran <jonnytran@gmail.com>

* Weave `isDeleting` through to `deleteSelectionPromise`

* fmt

---------

Co-authored-by: Jonathan Tran <jonnytran@gmail.com>
Co-authored-by: Pierre Jacquier <pierrejacquier39@gmail.com>
This commit is contained in:
Frank Noirot
2025-04-19 05:27:23 -04:00
committed by GitHub
parent 8c1a95833d
commit f30fc376ee
4 changed files with 36 additions and 10 deletions

View File

@ -38,9 +38,16 @@ export async function deleteSelectionPromise(
if (testExecute.errors.length) {
return new Error(deletionErrorMessage)
}
await updateModelingState(modifiedAst, EXECUTION_TYPE_REAL, {
kclManager,
editorManager,
codeManager,
})
await updateModelingState(
modifiedAst,
EXECUTION_TYPE_REAL,
{
kclManager,
editorManager,
codeManager,
},
{
isDeleting: true,
}
)
}