mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-12 11:08:31 -05:00
Add collapsed argument to insertCell extension method. (#7635)
This commit is contained in:
@@ -24,6 +24,8 @@ import { generateUuid } from 'vs/base/common/uuid';
|
||||
import { IModelContentChangedEvent } from 'vs/editor/common/model/textModelEvents';
|
||||
let modelId = 0;
|
||||
|
||||
export const HideInputTag = 'hide_input';
|
||||
|
||||
export class CellModel implements ICellModel {
|
||||
public id: string;
|
||||
|
||||
@@ -52,8 +54,6 @@ export class CellModel implements ICellModel {
|
||||
private _onCollapseStateChanged = new Emitter<boolean>();
|
||||
private _modelContentChangedEvent: IModelContentChangedEvent;
|
||||
|
||||
private readonly _hideInputTag = 'hide_input';
|
||||
|
||||
constructor(cellData: nb.ICellContents,
|
||||
private _options: ICellModelOptions,
|
||||
@optional(INotebookService) private _notebookService?: INotebookService
|
||||
@@ -112,7 +112,7 @@ export class CellModel implements ICellModel {
|
||||
|
||||
let tagIndex = -1;
|
||||
if (this._metadata.tags) {
|
||||
tagIndex = this._metadata.tags.findIndex(tag => tag === this._hideInputTag);
|
||||
tagIndex = this._metadata.tags.findIndex(tag => tag === HideInputTag);
|
||||
}
|
||||
|
||||
if (this._isCollapsed) {
|
||||
@@ -120,7 +120,7 @@ export class CellModel implements ICellModel {
|
||||
if (!this._metadata.tags) {
|
||||
this._metadata.tags = [];
|
||||
}
|
||||
this._metadata.tags.push(this._hideInputTag);
|
||||
this._metadata.tags.push(HideInputTag);
|
||||
}
|
||||
} else {
|
||||
if (tagIndex > -1) {
|
||||
@@ -605,7 +605,7 @@ export class CellModel implements ICellModel {
|
||||
this._source = this.getMultilineSource(cell.source);
|
||||
this._metadata = cell.metadata || {};
|
||||
|
||||
if (this._metadata.tags && this._metadata.tags.includes(this._hideInputTag)) {
|
||||
if (this._metadata.tags && this._metadata.tags.includes(HideInputTag)) {
|
||||
this._isCollapsed = true;
|
||||
} else {
|
||||
this._isCollapsed = false;
|
||||
|
||||
Reference in New Issue
Block a user