mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-01-16 01:25:36 -05:00
Run All Cells Notebook Implementation (#4713)
* runAllCells API * add comment * more run cells fixes * Add integration test * Add multiple cell SQL notebook test * Comment out python tests as they fail in the lab * remove unused imports * PR comments * Remove localize * Return true instead of promise.resolve(true)
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 runAllCells(): Thenable<boolean> {
|
||||
return this._proxy.$runAllCells(this._id);
|
||||
}
|
||||
|
||||
public clearAllOutputs(): Thenable<boolean> {
|
||||
return this._proxy.$clearAllOutputs(this._id);
|
||||
}
|
||||
|
||||
@@ -122,10 +122,16 @@ class MainThreadNotebookEditor extends Disposable {
|
||||
if (!this.editor) {
|
||||
return Promise.resolve(false);
|
||||
}
|
||||
|
||||
return this.editor.runCell(cell);
|
||||
}
|
||||
|
||||
public runAllCells(): Promise<boolean> {
|
||||
if (!this.editor) {
|
||||
return Promise.resolve(false);
|
||||
}
|
||||
return this.editor.runAllCells();
|
||||
}
|
||||
|
||||
public clearAllOutputs(): Promise<boolean> {
|
||||
if (!this.editor) {
|
||||
return Promise.resolve(false);
|
||||
@@ -366,6 +372,14 @@ export class MainThreadNotebookDocumentsAndEditors extends Disposable implements
|
||||
return editor.runCell(cell);
|
||||
}
|
||||
|
||||
$runAllCells(id: string): Promise<boolean> {
|
||||
let editor = this.getEditor(id);
|
||||
if (!editor) {
|
||||
return Promise.reject(disposed(`TextEditor(${id})`));
|
||||
}
|
||||
return editor.runAllCells();
|
||||
}
|
||||
|
||||
$clearAllOutputs(id: string): Promise<boolean> {
|
||||
let editor = this.getEditor(id);
|
||||
if (!editor) {
|
||||
|
||||
@@ -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>;
|
||||
$runAllCells(id: string): Promise<boolean>;
|
||||
$clearAllOutputs(id: string): Promise<boolean>;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user