mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-22 09:38:38 +01:00
Register "Change language" action and sync language change to ext host
This commit is contained in:
@@ -255,6 +255,8 @@ export class ExtHostNotebookDocument extends Disposable implements vscode.Notebo
|
||||
this.$clearCellOutputs(event.index);
|
||||
} else if (event.kind === NotebookCellsChangeType.CellsClearOutput) {
|
||||
this.$clearAllCellOutputs();
|
||||
} else if (event.kind === NotebookCellsChangeType.ChangeLanguage) {
|
||||
this.$changeCellLanguage(event.index, event.language);
|
||||
}
|
||||
|
||||
this._versionId = event.versionId;
|
||||
@@ -312,6 +314,11 @@ export class ExtHostNotebookDocument extends Disposable implements vscode.Notebo
|
||||
this.cells.forEach(cell => cell.outputs = []);
|
||||
}
|
||||
|
||||
private $changeCellLanguage(index: number, language: string) {
|
||||
const cell = this.cells[index];
|
||||
cell.language = language;
|
||||
}
|
||||
|
||||
eventuallyUpdateCellOutputs(cell: ExtHostCell, diffs: ISplice<vscode.CellOutput>[]) {
|
||||
let renderers = new Set<number>();
|
||||
let outputDtos: NotebookCellOutputsSplice[] = diffs.map(diff => {
|
||||
|
||||
Reference in New Issue
Block a user