Joyce Er
2021-08-18 23:16:21 +00:00
committed by GitHub
parent ea8021b893
commit 039751ded6
@@ -435,6 +435,31 @@ registerAction2(class extends Action2 {
}
});
registerAction2(class extends Action2 {
constructor() {
super({
id: 'interactive.input.clear',
title: { value: localize('interactive.input.clear', "Clear the interactive window input editor contents"), original: 'Clear the interactive window input editor contents' },
category: 'Interactive',
f1: false
});
}
async run(accessor: ServicesAccessor): Promise<void> {
const editorService = accessor.get(IEditorService);
const editorControl = editorService.activeEditorPane?.getControl() as { notebookEditor: NotebookEditorWidget | undefined, codeEditor: CodeEditorWidget; } | undefined;
if (editorControl && editorControl.notebookEditor && editorControl.codeEditor) {
const notebookDocument = editorControl.notebookEditor.textModel;
const textModel = editorControl.codeEditor.getModel();
if (notebookDocument && textModel) {
textModel.setValue('');
}
}
}
});
registerAction2(class extends Action2 {
constructor() {
super({