quick fix API polish (#168688)

* fix #167649

* Update src/vs/platform/terminal/common/xterm/terminalQuickFix.ts

* fix #167652

* add builtin everywhere for consistency

* fix  #167621 and fix #167646

* get rid of type in api

* fix  #167584

* fix #167587

* fix #167587

* fix #167590 and fix #167557

* Revert "fix #167652"

This reverts commit cf4cc72790.

* Update src/vs/workbench/contrib/terminal/common/terminal.ts

Co-authored-by: Daniel Imms <2193314+Tyriar@users.noreply.github.com>

* Update src/vscode-dts/vscode.proposed.terminalQuickFixProvider.d.ts

Co-authored-by: Daniel Imms <2193314+Tyriar@users.noreply.github.com>

* use const enum + more

* use classes

* update npm package.json

* add example for outputMatcher

* improve description

Co-authored-by: Daniel Imms <2193314+Tyriar@users.noreply.github.com>
This commit is contained in:
Megan Rogge
2022-12-13 12:32:54 -06:00
committed by GitHub
parent f99a293cef
commit 3e9bfdddc0
14 changed files with 122 additions and 98 deletions

View File

@@ -78,7 +78,7 @@ export async function activate(context: vscode.ExtensionContext): Promise<void>
}
const lines = outputMatch.regexMatch[1];
const fixes: vscode.TerminalQuickFixCommandAction[] = [];
const fixes: vscode.TerminalQuickFixCommand[] = [];
for (const line of lines.split('\n')) {
// search from the second char, since the lines might be prefixed with
// "npm ERR!" which comes before the actual command suggestion.
@@ -88,10 +88,7 @@ export async function activate(context: vscode.ExtensionContext): Promise<void>
}
const end = line.lastIndexOf('#');
fixes.push({
type: vscode.TerminalQuickFixType.command,
terminalCommand: line.slice(begin, end === -1 ? undefined : end - 1)
});
fixes.push({ terminalCommand: line.slice(begin, end === -1 ? undefined : end - 1) });
}
return fixes;