mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-08 17:19:48 +01:00
This commit is contained in:
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user