您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 

34 行
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;
}
}