From 28b2b9753c47c3d63077856dfd36beca6900d65e Mon Sep 17 00:00:00 2001 From: meganrogge Date: Tue, 15 Nov 2022 14:27:46 -0800 Subject: [PATCH] command -> commandLine --- src/vs/platform/terminal/common/terminal.ts | 4 ++-- .../terminal/browser/terminalQuickFixBuiltinActions.ts | 6 +++--- .../contrib/terminal/browser/xterm/quickFixAddon.ts | 3 +-- .../vscode.proposed.terminalQuickFixProvider.d.ts | 7 +------ 4 files changed, 7 insertions(+), 13 deletions(-) diff --git a/src/vs/platform/terminal/common/terminal.ts b/src/vs/platform/terminal/common/terminal.ts index 9ad7ce26a68..da382bb4c71 100644 --- a/src/vs/platform/terminal/common/terminal.ts +++ b/src/vs/platform/terminal/common/terminal.ts @@ -59,7 +59,7 @@ export type TerminalQuickFixCallbackExtension = (matchResult: TerminalCommandMat export interface TerminalCommandMatchResult { - command: { command: string; exitStatus: boolean }; + commandLine: string; commandLineMatch: RegExpMatchArray; // full match and groups outputMatch: RegExpMatchArray; @@ -86,7 +86,7 @@ export interface ITerminalQuickFixProvider { provideTerminalQuickFixes(commandMatchResult: TerminalCommandMatchResult, token?: CancellationToken): Promise; } export interface ITerminalCommandMatchResult { - command: { command: string; exitStatus: boolean }; + commandLine: string; commandLineMatch: RegExpMatchArray; // full match and groups outputMatch: RegExpMatchArray; diff --git a/src/vs/workbench/contrib/terminal/browser/terminalQuickFixBuiltinActions.ts b/src/vs/workbench/contrib/terminal/browser/terminalQuickFixBuiltinActions.ts index f35d8665e9f..dc7e228ecc1 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminalQuickFixBuiltinActions.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminalQuickFixBuiltinActions.ts @@ -41,7 +41,7 @@ export function gitSimilar(): IInternalOptions { actions.push({ id: 'Git Similar', type: 'command', - command: matchResult.command.command.replace(/git\s+[^\s]+/, `git ${fixedCommand}`), + command: matchResult.commandLine.replace(/git\s+[^\s]+/, `git ${fixedCommand}`), addNewLine: true }); } @@ -71,7 +71,7 @@ export function gitTwoDashes(): IInternalOptions { return { type: 'command', id: 'Git Two Dashes', - command: matchResult.command.command.replace(` -${problemArg}`, ` --${problemArg}`), + command: matchResult.commandLine.replace(` -${problemArg}`, ` --${problemArg}`), addNewLine: true }; } @@ -102,7 +102,7 @@ export function freePort(terminalInstance?: Partial): IIntern label, enabled: true, run: async () => { - await terminalInstance?.freePortKillProcess?.(port, matchResult.command.command); + await terminalInstance?.freePortKillProcess?.(port, matchResult.commandLine); } }; } diff --git a/src/vs/workbench/contrib/terminal/browser/xterm/quickFixAddon.ts b/src/vs/workbench/contrib/terminal/browser/xterm/quickFixAddon.ts index 8239cdeff21..518d75b793a 100644 --- a/src/vs/workbench/contrib/terminal/browser/xterm/quickFixAddon.ts +++ b/src/vs/workbench/contrib/terminal/browser/xterm/quickFixAddon.ts @@ -291,8 +291,7 @@ export async function getQuickFixesForCommand( if (!outputMatch) { continue; } - const command = { command: newCommand, exitStatus: terminalCommand.exitCode !== 0 }; - const matchResult = { commandLineMatch, outputMatch, command }; + const matchResult = { commandLineMatch, outputMatch, commandLine: terminalCommand.command }; const id = option.id; let quickFixes; switch (option.type) { diff --git a/src/vscode-dts/vscode.proposed.terminalQuickFixProvider.d.ts b/src/vscode-dts/vscode.proposed.terminalQuickFixProvider.d.ts index d0019e22516..9a18a5c2b5b 100644 --- a/src/vscode-dts/vscode.proposed.terminalQuickFixProvider.d.ts +++ b/src/vscode-dts/vscode.proposed.terminalQuickFixProvider.d.ts @@ -22,7 +22,7 @@ declare module 'vscode' { } export interface TerminalCommandMatchResult { - command: TerminalCommand; + commandLine: string; commandLineMatch: RegExpMatchArray; // full match and groups @@ -76,11 +76,6 @@ declare module 'vscode' { // ensure we can support all git similar using multiple lines } - export interface TerminalCommand { - command: string; - exitCode?: number; - } - enum TerminalOutputAnchor { top = 'top', bottom = 'bottom'