mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 18:46:40 -05:00
Fix tags issue where metadata was not preserved (#6219)
This commit is contained in:
@@ -43,6 +43,7 @@ export class CellModel implements ICellModel {
|
|||||||
private _onCellLoaded = new Emitter<string>();
|
private _onCellLoaded = new Emitter<string>();
|
||||||
private _loaded: boolean;
|
private _loaded: boolean;
|
||||||
private _stdInVisible: boolean;
|
private _stdInVisible: boolean;
|
||||||
|
private _metadata: { language?: string; };
|
||||||
|
|
||||||
constructor(cellData: nb.ICellContents,
|
constructor(cellData: nb.ICellContents,
|
||||||
private _options: ICellModelOptions,
|
private _options: ICellModelOptions,
|
||||||
@@ -511,8 +512,7 @@ export class CellModel implements ICellModel {
|
|||||||
let cellJson: Partial<nb.ICellContents> = {
|
let cellJson: Partial<nb.ICellContents> = {
|
||||||
cell_type: this._cellType,
|
cell_type: this._cellType,
|
||||||
source: this._source,
|
source: this._source,
|
||||||
metadata: {
|
metadata: this._metadata || {}
|
||||||
}
|
|
||||||
};
|
};
|
||||||
if (this._cellType === CellTypes.Code) {
|
if (this._cellType === CellTypes.Code) {
|
||||||
cellJson.metadata.language = this._language,
|
cellJson.metadata.language = this._language,
|
||||||
@@ -529,6 +529,7 @@ export class CellModel implements ICellModel {
|
|||||||
this._cellType = cell.cell_type;
|
this._cellType = cell.cell_type;
|
||||||
this.executionCount = cell.execution_count;
|
this.executionCount = cell.execution_count;
|
||||||
this._source = Array.isArray(cell.source) ? cell.source.join('') : cell.source;
|
this._source = Array.isArray(cell.source) ? cell.source.join('') : cell.source;
|
||||||
|
this._metadata = cell.metadata;
|
||||||
this.setLanguageFromContents(cell);
|
this.setLanguageFromContents(cell);
|
||||||
if (cell.outputs) {
|
if (cell.outputs) {
|
||||||
for (let output of cell.outputs) {
|
for (let output of cell.outputs) {
|
||||||
|
|||||||
Reference in New Issue
Block a user