mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-17 09:35:37 -05:00
* #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:
@@ -156,6 +156,10 @@ export class ExtHostNotebookEditor implements azdata.nb.NotebookEditor, IDisposa
|
||||
return this._proxy.$runCell(this._id, uri);
|
||||
}
|
||||
|
||||
public clearAllOutputs(): Thenable<boolean> {
|
||||
return this._proxy.$clearAllOutputs(this._id);
|
||||
}
|
||||
|
||||
public edit(callback: (editBuilder: azdata.nb.NotebookEditorEdit) => void, options?: { undoStopBefore: boolean; undoStopAfter: boolean; }): Thenable<boolean> {
|
||||
if (this._disposed) {
|
||||
return Promise.reject(new Error('NotebookEditor#edit not possible on closed editors'));
|
||||
|
||||
@@ -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> {
|
||||
|
||||
@@ -866,6 +866,7 @@ export interface MainThreadNotebookDocumentsAndEditorsShape extends IDisposable
|
||||
$tryShowNotebookDocument(resource: UriComponents, options: INotebookShowOptions): Promise<string>;
|
||||
$tryApplyEdits(id: string, modelVersionId: number, edits: ISingleNotebookEditOperation[], opts: IUndoStopOptions): Promise<boolean>;
|
||||
$runCell(id: string, cellUri: UriComponents): Promise<boolean>;
|
||||
$clearAllOutputs(id: string): Promise<boolean>;
|
||||
}
|
||||
|
||||
export interface ExtHostExtensionManagementShape {
|
||||
|
||||
Reference in New Issue
Block a user