Skip to content

Commit 46b0380

Browse files
committed
Add hack note, improve condition
1 parent 8a6551b commit 46b0380

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/vs/workbench/contrib/terminalContrib/suggest/browser/terminalCompletionModel.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ const compareCompletionsFn = (leadingLineContent: string, a: TerminalCompletionI
3939
}
4040

4141
// Boost main and master branches for git commands
42-
if (/^\s*git\b/.test(leadingLineContent) && a.completion.provider === 'terminal-suggest' && b.completion.provider === 'terminal-suggest') {
42+
// HACK: Currently this just matches leading line content, it should eventually check the
43+
// completion type is a branch
44+
if (a.completion.kind === TerminalCompletionItemKind.Method && b.completion.kind === TerminalCompletionItemKind.Method && /^\s*git\b/.test(leadingLineContent)) {
4345
const aLabel = typeof a.completion.label === 'string' ? a.completion.label : a.completion.label.label;
4446
const bLabel = typeof b.completion.label === 'string' ? b.completion.label : b.completion.label.label;
4547
const aIsMainOrMaster = aLabel === 'main' || aLabel === 'master';

0 commit comments

Comments
 (0)