This commit is contained in:
Sandeep Somavarapu
2018-02-05 12:10:21 +01:00
parent 5b6a681cc2
commit 19e54fd1fd

View File

@@ -35,18 +35,22 @@ export class ExtHostOutputChannel implements vscode.OutputChannel {
}
append(value: string): void {
this.validate();
this._proxy.$append(this._id, this._name, value);
}
appendLine(value: string): void {
this.validate();
this.append(value + '\n');
}
clear(): void {
this.validate();
this._proxy.$clear(this._id, this._name);
}
show(columnOrPreserveFocus?: vscode.ViewColumn | boolean, preserveFocus?: boolean): void {
this.validate();
if (typeof columnOrPreserveFocus === 'boolean') {
preserveFocus = columnOrPreserveFocus;
}
@@ -55,8 +59,15 @@ export class ExtHostOutputChannel implements vscode.OutputChannel {
}
hide(): void {
this.validate();
this._proxy.$close(this._id);
}
private validate(): void {
if (this._disposed) {
throw new Error('Channel has been closed');
}
}
}
export class ExtHostOutputService {