mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-25 19:18:59 +01:00
change IOutputItemDto to use real bytes, add many dedicated dto-types for transporting output (which cannot be bytes), remove metadata2 from renderer
This commit is contained in:
@@ -8,9 +8,10 @@ import { CancellationToken } from 'vs/base/common/cancellation';
|
||||
import { Emitter } from 'vs/base/common/event';
|
||||
import { DisposableStore, dispose, IDisposable } from 'vs/base/common/lifecycle';
|
||||
import { URI } from 'vs/base/common/uri';
|
||||
import { NotebookDto } from 'vs/workbench/api/browser/mainThreadNotebookDto';
|
||||
import { extHostNamedCustomer } from 'vs/workbench/api/common/extHostCustomers';
|
||||
import { INotebookCellStatusBarService } from 'vs/workbench/contrib/notebook/common/notebookCellStatusBarService';
|
||||
import { INotebookCellStatusBarItemProvider, INotebookContributionData, NotebookDataDto, TransientCellMetadata, TransientDocumentMetadata, TransientOptions } from 'vs/workbench/contrib/notebook/common/notebookCommon';
|
||||
import { INotebookCellStatusBarItemProvider, INotebookContributionData, NotebookData as NotebookData, TransientCellMetadata, TransientDocumentMetadata, TransientOptions } from 'vs/workbench/contrib/notebook/common/notebookCommon';
|
||||
import { INotebookContentProvider, INotebookService } from 'vs/workbench/contrib/notebook/common/notebookService';
|
||||
import { ExtHostContext, ExtHostNotebookShape, IExtHostContext, MainContext, MainThreadNotebookShape, NotebookExtensionDescription } from '../common/extHost.protocol';
|
||||
|
||||
@@ -56,7 +57,7 @@ export class MainThreadNotebooks implements MainThreadNotebookShape {
|
||||
open: async (uri: URI, backupId: string | undefined, untitledDocumentData: VSBuffer | undefined, token: CancellationToken) => {
|
||||
const data = await this._proxy.$openNotebook(viewType, uri, backupId, untitledDocumentData, token);
|
||||
return {
|
||||
data,
|
||||
data: NotebookDto.fromNotebookDataDto(data),
|
||||
transientOptions: contentOptions
|
||||
};
|
||||
},
|
||||
@@ -100,14 +101,16 @@ export class MainThreadNotebooks implements MainThreadNotebookShape {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$registerNotebookSerializer(handle: number, extension: NotebookExtensionDescription, viewType: string, options: TransientOptions, data: INotebookContributionData | undefined): void {
|
||||
const registration = this._notebookService.registerNotebookSerializer(viewType, extension, {
|
||||
options,
|
||||
dataToNotebook: (data: VSBuffer): Promise<NotebookDataDto> => {
|
||||
return this._proxy.$dataToNotebook(handle, data, CancellationToken.None);
|
||||
dataToNotebook: async (data: VSBuffer): Promise<NotebookData> => {
|
||||
const dto = await this._proxy.$dataToNotebook(handle, data, CancellationToken.None);
|
||||
return NotebookDto.fromNotebookDataDto(dto);
|
||||
},
|
||||
notebookToData: (data: NotebookDataDto): Promise<VSBuffer> => {
|
||||
return this._proxy.$notebookToData(handle, data, CancellationToken.None);
|
||||
notebookToData: (data: NotebookData): Promise<VSBuffer> => {
|
||||
return this._proxy.$notebookToData(handle, NotebookDto.toNotebookDataDto(data), CancellationToken.None);
|
||||
}
|
||||
});
|
||||
const disposables = new DisposableStore();
|
||||
|
||||
Reference in New Issue
Block a user