25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

34 lines
1.0 KiB

'use strict';
import { window } from 'vscode';
import { Container } from '../container';
import { Iterables } from '../system';
import { CommandQuickPickItem, getQuickPickIgnoreFocusOut } from './commonQuickPicks';
import { RepositoryQuickPickItem } from './gitQuickPicks';
export class RepositoriesQuickPick {
static async show(
placeHolder: string,
goBackCommand?: CommandQuickPickItem
): Promise<RepositoryQuickPickItem | CommandQuickPickItem | undefined> {
const items: (RepositoryQuickPickItem | CommandQuickPickItem)[] = await Promise.all([
...Iterables.map(await Container.git.getOrderedRepositories(), r =>
RepositoryQuickPickItem.create(r, undefined, { branch: true, status: true })
)
]);
if (goBackCommand !== undefined) {
items.splice(0, 0, goBackCommand);
}
// const scope = await Container.keyboard.beginScope({ left: goBackCommand });
const pick = await window.showQuickPick(items, {
placeHolder: placeHolder,
ignoreFocusOut: getQuickPickIgnoreFocusOut()
});
// await scope.dispose();
return pick;
}
}