mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-02 06:21:50 +01:00
make INotebookKernel2 extends INotebookKernel
This commit is contained in:
@@ -89,8 +89,13 @@ abstract class MainThreadKernel implements INotebookKernel2 {
|
||||
this._onDidChange.fire(event);
|
||||
}
|
||||
|
||||
abstract executeNotebookCellsRequest(uri: URI, ranges: ICellRange[]): void;
|
||||
abstract cancelNotebookCellExecution(uri: URI, ranges: ICellRange[]): void;
|
||||
abstract executeNotebookCellsRequest(uri: URI, ranges: ICellRange[]): Promise<void>;
|
||||
abstract cancelNotebookCellExecution(uri: URI, ranges: ICellRange[]): Promise<void>;
|
||||
|
||||
// old stuff
|
||||
readonly resolve = () => Promise.resolve();
|
||||
get friendlyId() { return this.id; }
|
||||
get providerHandle() { return undefined; }
|
||||
}
|
||||
|
||||
@extHostNamedCustomer(MainContext.MainThreadNotebookKernels)
|
||||
@@ -185,11 +190,11 @@ export class MainThreadNotebookKernels implements MainThreadNotebookKernelsShape
|
||||
async $addKernel(handle: number, data: INotebookKernelDto2): Promise<void> {
|
||||
const that = this;
|
||||
const kernel = new class extends MainThreadKernel {
|
||||
executeNotebookCellsRequest(uri: URI, ranges: ICellRange[]): void {
|
||||
that._proxy.$executeCells(handle, uri, ranges);
|
||||
async executeNotebookCellsRequest(uri: URI, ranges: ICellRange[]): Promise<void> {
|
||||
await that._proxy.$executeCells(handle, uri, ranges);
|
||||
}
|
||||
cancelNotebookCellExecution(uri: URI, ranges: ICellRange[]): void {
|
||||
that._proxy.$cancelCells(handle, uri, ranges);
|
||||
async cancelNotebookCellExecution(uri: URI, ranges: ICellRange[]): Promise<void> {
|
||||
await that._proxy.$cancelCells(handle, uri, ranges);
|
||||
}
|
||||
}(data);
|
||||
const registration = this._notebookKernelService.registerKernel(kernel);
|
||||
|
||||
Reference in New Issue
Block a user