mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-26 19:44:25 +01:00
@@ -54,6 +54,7 @@ export class ExtHostCell {
|
||||
readonly cellKind: notebookCommon.CellKind;
|
||||
|
||||
private _apiCell: vscode.NotebookCell | undefined;
|
||||
private _mime: string | undefined;
|
||||
|
||||
constructor(
|
||||
readonly notebook: ExtHostNotebookDocument,
|
||||
@@ -85,6 +86,8 @@ export class ExtHostCell {
|
||||
notebook: that.notebook.apiNotebook,
|
||||
kind: extHostTypeConverters.NotebookCellKind.to(this._cellData.cellKind),
|
||||
document: data.document,
|
||||
get mime() { return that._mime; },
|
||||
set mime(value: string | undefined) { that._mime = value; },
|
||||
get outputs() { return that._outputs.slice(0); },
|
||||
get metadata() { return that._metadata; },
|
||||
get executionSummary() { return that._previousResult; }
|
||||
@@ -116,6 +119,10 @@ export class ExtHostCell {
|
||||
this._internalMetadata = newInternalMetadata;
|
||||
this._previousResult = extHostTypeConverters.NotebookCellExecutionSummary.to(newInternalMetadata);
|
||||
}
|
||||
|
||||
setMime(newMime: string | undefined) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
export interface INotebookEventEmitter {
|
||||
@@ -223,6 +230,8 @@ export class ExtHostNotebookDocument {
|
||||
this._setCellOutputItems(rawEvent.index, rawEvent.outputId, rawEvent.append, rawEvent.outputItems);
|
||||
} else if (rawEvent.kind === notebookCommon.NotebookCellsChangeType.ChangeLanguage) {
|
||||
this._changeCellLanguage(rawEvent.index, rawEvent.language);
|
||||
} else if (rawEvent.kind === notebookCommon.NotebookCellsChangeType.ChangeCellMime) {
|
||||
this._changeCellMime(rawEvent.index, rawEvent.mime);
|
||||
} else if (rawEvent.kind === notebookCommon.NotebookCellsChangeType.ChangeCellMetadata) {
|
||||
this._changeCellMetadata(rawEvent.index, rawEvent.metadata);
|
||||
} else if (rawEvent.kind === notebookCommon.NotebookCellsChangeType.ChangeCellInternalMetadata) {
|
||||
@@ -345,6 +354,11 @@ export class ExtHostNotebookDocument {
|
||||
}
|
||||
}
|
||||
|
||||
private _changeCellMime(index: number, newMime: string | undefined): void {
|
||||
const cell = this._cells[index];
|
||||
cell.apiCell.mime = newMime;
|
||||
}
|
||||
|
||||
private _changeCellMetadata(index: number, newMetadata: notebookCommon.NotebookCellMetadata): void {
|
||||
const cell = this._cells[index];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user