Skip to content

Commit 6caaff1

Browse files
committed
Adds better quickpick msg when no repos are open
1 parent 4bb6ed5 commit 6caaff1

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

src/commands/quickCommand.steps.ts

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1540,10 +1540,15 @@ export async function* pickRepositoryStep<
15401540

15411541
const step = createPickStep<RepositoryQuickPickItem>({
15421542
title: context.title,
1543-
placeholder: placeholder,
1543+
placeholder: context.repos.length === 0 ? `${placeholder} — no opened repositories found` : placeholder,
15441544
items:
15451545
context.repos.length === 0
1546-
? [createDirectiveQuickPickItem(Directive.Cancel)]
1546+
? [
1547+
createDirectiveQuickPickItem(Directive.Cancel, true, {
1548+
label: 'Cancel',
1549+
detail: 'No opened repositories found',
1550+
}),
1551+
]
15471552
: Promise.all(
15481553
context.repos.map(r =>
15491554
createRepositoryQuickPickItem(r, r.id === active?.id, {
@@ -1605,10 +1610,16 @@ export async function* pickRepositoriesStep<
16051610
const step = createPickStep<RepositoryQuickPickItem>({
16061611
multiselect: true,
16071612
title: context.title,
1608-
placeholder: options.placeholder,
1613+
placeholder:
1614+
context.repos.length === 0 ? `${options.placeholder} — no opened repositories found` : options.placeholder,
16091615
items:
16101616
context.repos.length === 0
1611-
? [createDirectiveQuickPickItem(Directive.Cancel)]
1617+
? [
1618+
createDirectiveQuickPickItem(Directive.Cancel, true, {
1619+
label: 'Cancel',
1620+
detail: 'No opened repositories found',
1621+
}),
1622+
]
16121623
: Promise.all(
16131624
context.repos.map(repo =>
16141625
createRepositoryQuickPickItem(

0 commit comments

Comments
 (0)