diff --git a/src/vs/vscode.d.ts b/src/vs/vscode.d.ts index ee6e909751e..b6d6d242d53 100644 --- a/src/vs/vscode.d.ts +++ b/src/vs/vscode.d.ts @@ -2362,8 +2362,9 @@ declare namespace vscode { * Reveal this channel in the UI. * * @param column The column in which to show the channel, default in [one](#ViewColumn.One). + * @param preserveFocus When `true` the channel will not take focus. */ - show(column?: ViewColumn): void; + show(column?: ViewColumn, preserveFocus?: boolean): void; /** * Hide this channel from the UI. @@ -2708,9 +2709,10 @@ declare namespace vscode { * @param document A text document to be shown. * @param column A view column in which the editor should be shown. The default is the [one](#ViewColumn.One), other values * are adjusted to be __Min(column, columnCount + 1)__. + * @param preserveFocus When `true` the editor will not take focus. * @return A promise that resolves to an [editor](#TextEditor). */ - export function showTextDocument(document: TextDocument, column?: ViewColumn): Thenable; + export function showTextDocument(document: TextDocument, column?: ViewColumn, preserveFocus?: boolean): Thenable; /** * Create a TextEditorDecorationType that can be used to add decorations to text editors. diff --git a/src/vs/workbench/api/common/extHost.api.impl.ts b/src/vs/workbench/api/common/extHost.api.impl.ts index 2808970b9f6..f24d9b2880e 100644 --- a/src/vs/workbench/api/common/extHost.api.impl.ts +++ b/src/vs/workbench/api/common/extHost.api.impl.ts @@ -160,8 +160,8 @@ export class ExtHostAPIImplementation { get visibleTextEditors() { return pluginHostEditors.getVisibleTextEditors(); }, - showTextDocument(document: vscode.TextDocument, column: vscode.ViewColumn): TPromise { - return pluginHostEditors.showTextDocument(document, column); + showTextDocument(document: vscode.TextDocument, column?: vscode.ViewColumn, preserveFocus?: boolean): TPromise { + return pluginHostEditors.showTextDocument(document, column, preserveFocus); }, createTextEditorDecorationType(options:vscode.DecorationRenderOptions): vscode.TextEditorDecorationType { return pluginHostEditors.createTextEditorDecorationType(options); diff --git a/src/vs/workbench/api/common/extHostEditors.ts b/src/vs/workbench/api/common/extHostEditors.ts index 0c68f7b057c..1e81644b317 100644 --- a/src/vs/workbench/api/common/extHostEditors.ts +++ b/src/vs/workbench/api/common/extHostEditors.ts @@ -75,8 +75,8 @@ export class ExtHostEditors { return this._onDidChangeActiveTextEditor && this._onDidChangeActiveTextEditor.event; } - showTextDocument(document: TextDocument, column: ViewColumn): TPromise { - return this._proxy._tryShowTextDocument( document.uri, TypeConverters.fromViewColumn(column)).then(id => { + showTextDocument(document: TextDocument, column: ViewColumn, preserveFocus: boolean): TPromise { + return this._proxy._tryShowTextDocument( document.uri, TypeConverters.fromViewColumn(column), preserveFocus).then(id => { let editor = this._editors[id]; if (editor) { return editor; @@ -525,12 +525,12 @@ export class MainThreadEditors { // --- from plugin host process - _tryShowTextDocument(resource: URI, position: EditorPosition): TPromise { + _tryShowTextDocument(resource: URI, position: EditorPosition, preserveFocus: boolean): TPromise { // the input we want to open let input = { resource, - options: { preserveFocus: false } + options: { preserveFocus } }; return this._workbenchEditorService.openEditor(input, position).then(editor => { diff --git a/src/vs/workbench/api/common/extHostOutputService.ts b/src/vs/workbench/api/common/extHostOutputService.ts index b66ae56f4d1..e5276f0f7f2 100644 --- a/src/vs/workbench/api/common/extHostOutputService.ts +++ b/src/vs/workbench/api/common/extHostOutputService.ts @@ -47,8 +47,8 @@ export class ExtHostOutputChannel implements vscode.OutputChannel { this._proxy.clear(this._name); } - show(column?: vscode.ViewColumn): void { - this._proxy.reveal(this._name, TypeConverters.fromViewColumn(column)); + show(column?: vscode.ViewColumn, preserveFocus?: boolean): void { + this._proxy.reveal(this._name, TypeConverters.fromViewColumn(column), preserveFocus); } hide(): void { @@ -95,8 +95,8 @@ export class MainThreadOutputService { return undefined; } - public reveal(channel: string, position: Position): TPromise { - this._outputService.showOutput(channel, position); + public reveal(channel: string, position: Position, preserveFocus: boolean): TPromise { + this._outputService.showOutput(channel, position, preserveFocus); return undefined; }