#4586: Clear Results feature in Notebooks (#4705)

* #4586: Clear all outputs feature

* text change

* Adding extensible method with integration tests

* Misc change

* Misc change

* Adding more logging

* Change to test

* Adding outputs confition in integration tests
This commit is contained in:
Raj
2019-03-28 15:20:28 -07:00
committed by GitHub
parent 7eb17f6abc
commit 1415aa1c03
11 changed files with 108 additions and 3 deletions

View File

@@ -125,6 +125,13 @@ class MainThreadNotebookEditor extends Disposable {
return this.editor.runCell(cell);
}
public clearAllOutputs(): Promise<boolean> {
if (!this.editor) {
return Promise.resolve(false);
}
return this.editor.clearAllOutputs();
}
}
function wait(timeMs: number): Promise<void> {
@@ -359,6 +366,14 @@ export class MainThreadNotebookDocumentsAndEditors extends Disposable implements
return editor.runCell(cell);
}
$clearAllOutputs(id: string): Promise<boolean> {
let editor = this.getEditor(id);
if (!editor) {
return Promise.reject(disposed(`TextEditor(${id})`));
}
return editor.clearAllOutputs();
}
//#endregion
private async doOpenEditor(resource: UriComponents, options: INotebookShowOptions): Promise<string> {