mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-26 03:29:00 +01:00
Add replaceAll method to OutputChannel to improve render flickering for extensions with minimal output contents; associated with https://github.com/microsoft/vscode/issues/132183
This commit is contained in:
@@ -447,6 +447,7 @@ export interface MainThreadOutputServiceShape extends IDisposable {
|
||||
$append(channelId: string, value: string): Promise<void> | undefined;
|
||||
$update(channelId: string): Promise<void> | undefined;
|
||||
$clear(channelId: string, till: number): Promise<void> | undefined;
|
||||
$replaceAll(channelId: string, till: number, value: string): Promise<void> | undefined;
|
||||
$reveal(channelId: string, preserveFocus: boolean): Promise<void> | undefined;
|
||||
$close(channelId: string): Promise<void> | undefined;
|
||||
$dispose(channelId: string): Promise<void> | undefined;
|
||||
|
||||
@@ -58,6 +58,13 @@ export abstract class AbstractExtHostOutputChannel extends Disposable implements
|
||||
this._id.then(id => this._proxy.$clear(id, till));
|
||||
}
|
||||
|
||||
replaceAll(value: string): void {
|
||||
this.validate();
|
||||
const till = this._offset;
|
||||
this._offset += value ? VSBuffer.fromString(value).byteLength : 0;
|
||||
this._id.then(id => this._proxy.$replaceAll(id, till, value));
|
||||
}
|
||||
|
||||
show(columnOrPreserveFocus?: vscode.ViewColumn | boolean, preserveFocus?: boolean): void {
|
||||
this.validate();
|
||||
this._id.then(id => this._proxy.$reveal(id, !!(typeof columnOrPreserveFocus === 'boolean' ? columnOrPreserveFocus : preserveFocus)));
|
||||
@@ -125,6 +132,9 @@ export class LazyOutputChannel implements vscode.OutputChannel {
|
||||
clear(): void {
|
||||
this._channel.then(channel => channel.clear());
|
||||
}
|
||||
replaceAll(value: string): void {
|
||||
this._channel.then(channel => channel.replaceAll(value));
|
||||
}
|
||||
show(columnOrPreserveFocus?: vscode.ViewColumn | boolean, preserveFocus?: boolean): void {
|
||||
this._channel.then(channel => channel.show(columnOrPreserveFocus, preserveFocus));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user