mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-25 11:08:51 +01:00
adding TextDocument#isVisible and internals for a visbility change event, #15723
This commit is contained in:
@@ -28,6 +28,7 @@ export class ExtHostDocumentData extends MirrorModel2 {
|
||||
private _proxy: MainThreadDocumentsShape;
|
||||
private _languageId: string;
|
||||
private _isDirty: boolean;
|
||||
private _isVisible: boolean = false;
|
||||
private _document: vscode.TextDocument;
|
||||
private _textLines: vscode.TextLine[] = [];
|
||||
private _isDisposed: boolean = false;
|
||||
@@ -48,6 +49,7 @@ export class ExtHostDocumentData extends MirrorModel2 {
|
||||
ok(!this._isDisposed);
|
||||
this._isDisposed = true;
|
||||
this._isDirty = false;
|
||||
this._isVisible = false;
|
||||
}
|
||||
|
||||
equalLines({ lines }: ITextSource): boolean {
|
||||
@@ -72,6 +74,7 @@ export class ExtHostDocumentData extends MirrorModel2 {
|
||||
get isUntitled() { return data._uri.scheme !== 'file'; },
|
||||
get languageId() { return data._languageId; },
|
||||
get version() { return data._versionId; },
|
||||
get isVisible() { return data._isVisible; },
|
||||
get isDirty() { return data._isDirty; },
|
||||
save() { return data._save(); },
|
||||
getText(range?) { return range ? data._getTextInRange(range) : data.getText(); },
|
||||
@@ -97,6 +100,16 @@ export class ExtHostDocumentData extends MirrorModel2 {
|
||||
this._isDirty = isDirty;
|
||||
}
|
||||
|
||||
_acceptIsVisible(value: boolean): boolean {
|
||||
ok(!this._isDisposed);
|
||||
if (this._isVisible === value) {
|
||||
return false;
|
||||
} else {
|
||||
this._isVisible = value;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
private _save(): TPromise<boolean> {
|
||||
if (this._isDisposed) {
|
||||
return TPromise.wrapError<boolean>('Document has been closed');
|
||||
|
||||
Reference in New Issue
Block a user