diff --git a/src/vs/vscode.d.ts b/src/vs/vscode.d.ts index 891ffe7d8d5c7..225725b29b258 100644 --- a/src/vs/vscode.d.ts +++ b/src/vs/vscode.d.ts @@ -6229,11 +6229,16 @@ declare module 'vscode' { export function createInputBox(): InputBox; /** - * Create a new [output channel](#OutputChannel) with the given name. + * Creates a new [output channel](#OutputChannel) with the given name. + * + * By default, Output channels use a separate transport mechanism when appending data. + * This helps to reduce CPU load on the UI process but also means that the output channel UI updates with a small delay. + * Use the force-flag to enforce immediate updates at the cost of higher CPU usage. * * @param name Human-readable string which will be used to represent the channel in the UI. + * @param options Options to control how the channel will be created. */ - export function createOutputChannel(name: string): OutputChannel; + export function createOutputChannel(name: string, options?: { force?: boolean }): OutputChannel; /** * Create and show a new webview panel. diff --git a/src/vs/workbench/api/node/extHost.api.impl.ts b/src/vs/workbench/api/node/extHost.api.impl.ts index 9babb878ec9e2..eb28fffe125ae 100644 --- a/src/vs/workbench/api/node/extHost.api.impl.ts +++ b/src/vs/workbench/api/node/extHost.api.impl.ts @@ -435,8 +435,8 @@ export function createApiFactory( withProgress(options: vscode.ProgressOptions, task: (progress: vscode.Progress<{ message?: string; worked?: number }>, token: vscode.CancellationToken) => Thenable) { return extHostProgress.withProgress(extension, options, task); }, - createOutputChannel(name: string, push?: boolean): vscode.OutputChannel { - return extHostOutputService.createOutputChannel(name, push); + createOutputChannel(name: string, options?: { force?: boolean }): vscode.OutputChannel { + return extHostOutputService.createOutputChannel(name, options); }, createWebviewPanel(viewType: string, title: string, showOptions: vscode.ViewColumn | { viewColumn: vscode.ViewColumn, preserveFocus?: boolean }, options: vscode.WebviewPanelOptions & vscode.WebviewOptions): vscode.WebviewPanel { return extHostWebviews.createWebview(extension.extensionLocation, viewType, title, showOptions, options); diff --git a/src/vs/workbench/api/node/extHostOutputService.ts b/src/vs/workbench/api/node/extHostOutputService.ts index 1fd525bf8a450..f9c857bfb3386 100644 --- a/src/vs/workbench/api/node/extHostOutputService.ts +++ b/src/vs/workbench/api/node/extHostOutputService.ts @@ -117,12 +117,12 @@ export class ExtHostOutputService { this._proxy = mainContext.getProxy(MainContext.MainThreadOutputService); } - createOutputChannel(name: string, push: boolean): vscode.OutputChannel { + createOutputChannel(name: string, options?: { force?: boolean }): vscode.OutputChannel { name = name.trim(); if (!name) { throw new Error('illegal argument `name`. must not be falsy'); } else { - if (push) { + if (options && options.force) { return new ExtHostPushOutputChannel(name, this._proxy); } else { // Do not crash if logger cannot be created