Open in background on vscode.[open|openWith|diff]

This commit is contained in:
Eric Amodio
2020-05-05 02:07:51 -04:00
committed by Eric Amodio
parent c6f4de2336
commit 748fc4021a
2 changed files with 15 additions and 10 deletions

View File

@@ -97,12 +97,12 @@ CommandsRegistry.registerCommand({
export class DiffAPICommand {
public static readonly ID = 'vscode.diff';
public static execute(executor: ICommandsExecutor, left: URI, right: URI, label: string, options?: vscode.TextDocumentShowOptions): Promise<any> {
public static execute(executor: ICommandsExecutor, left: URI, right: URI, label: string, options?: typeConverters.TextEditorOpenOptions): Promise<any> {
return executor.executeCommand('_workbench.diff', [
left, right,
label,
undefined,
typeConverters.TextEditorOptions.from(options),
typeConverters.TextEditorOpenOptions.from(options),
options ? typeConverters.ViewColumn.from(options.viewColumn) : undefined
]);
}
@@ -111,7 +111,7 @@ CommandsRegistry.registerCommand(DiffAPICommand.ID, adjustHandler(DiffAPICommand
export class OpenAPICommand {
public static readonly ID = 'vscode.open';
public static execute(executor: ICommandsExecutor, resource: URI, columnOrOptions?: vscode.ViewColumn | vscode.TextDocumentShowOptions, label?: string): Promise<any> {
public static execute(executor: ICommandsExecutor, resource: URI, columnOrOptions?: vscode.ViewColumn | typeConverters.TextEditorOpenOptions, label?: string): Promise<any> {
let options: ITextEditorOptions | undefined;
let position: EditorViewColumn | undefined;
@@ -119,7 +119,7 @@ export class OpenAPICommand {
if (typeof columnOrOptions === 'number') {
position = typeConverters.ViewColumn.from(columnOrOptions);
} else {
options = typeConverters.TextEditorOptions.from(columnOrOptions);
options = typeConverters.TextEditorOpenOptions.from(columnOrOptions);
position = typeConverters.ViewColumn.from(columnOrOptions.viewColumn);
}
}
@@ -136,14 +136,14 @@ CommandsRegistry.registerCommand(OpenAPICommand.ID, adjustHandler(OpenAPICommand
export class OpenWithAPICommand {
public static readonly ID = 'vscode.openWith';
public static execute(executor: ICommandsExecutor, resource: URI, viewType: string, columnOrOptions?: vscode.ViewColumn | vscode.TextDocumentShowOptions): Promise<any> {
public static execute(executor: ICommandsExecutor, resource: URI, viewType: string, columnOrOptions?: vscode.ViewColumn | typeConverters.TextEditorOpenOptions): Promise<any> {
let options: ITextEditorOptions | undefined;
let position: EditorViewColumn | undefined;
if (typeof columnOrOptions === 'number') {
position = typeConverters.ViewColumn.from(columnOrOptions);
} else if (typeof columnOrOptions !== 'undefined') {
options = typeConverters.TextEditorOptions.from(columnOrOptions);
options = typeConverters.TextEditorOpenOptions.from(columnOrOptions);
}
return executor.executeCommand('_workbench.openWith', [