浏览代码

Brings quickpick in line with menu rework

main
Eric Amodio 4 年前
父节点
当前提交
787bc8f3a9
共有 2 个文件被更改,包括 15 次插入12 次删除
  1. +12
    -9
      src/commands/quickCommand.steps.ts
  2. +3
    -3
      src/quickpicks/commitQuickPickItems.ts

+ 12
- 9
src/commands/quickCommand.steps.ts 查看文件

@ -1379,6 +1379,8 @@ async function getShowCommitOrStashStepItems<
if (GitStashCommit.is(state.reference)) {
isStash = true;
items.push(new RevealInSideBarQuickPickItem(state.reference));
items.push(
new GitCommandQuickPickItem('Apply Stash...', {
command: 'stash',
@ -1397,11 +1399,15 @@ async function getShowCommitOrStashStepItems<
reference: state.reference,
},
}),
new RevealInSideBarQuickPickItem(state.reference),
);
} else {
remotes = await Container.git.getRemotes(state.repo.path, { sort: true });
items.push(
new RevealInSideBarQuickPickItem(state.reference),
new SearchForCommitQuickPickItem(state.reference),
);
if (
branch != null &&
(await Container.git.branchContainsCommit(state.repo.path, branch.name, state.reference.ref))
@ -1507,8 +1513,6 @@ async function getShowCommitOrStashStepItems<
);
}
items.push(new RevealInSideBarQuickPickItem(state.reference));
if (isStash) {
items.push(
new CommitBrowseRepositoryFromHereCommandQuickPickItem(state.reference, false),
@ -1519,8 +1523,6 @@ async function getShowCommitOrStashStepItems<
);
} else {
items.push(
new SearchForCommitQuickPickItem(state.reference),
new CommitBrowseRepositoryFromHereCommandQuickPickItem(state.reference, false),
new CommitBrowseRepositoryFromHereCommandQuickPickItem(state.reference, true),
@ -1712,10 +1714,15 @@ async function getShowCommitOrStashFileStepItems<
let isStash = false;
if (GitStashCommit.is(state.reference)) {
isStash = true;
items.push(new RevealInSideBarQuickPickItem(state.reference));
} else {
remotes = await Container.git.getRemotes(state.repo.path, { sort: true });
items.push(
new RevealInSideBarQuickPickItem(state.reference),
new SearchForCommitQuickPickItem(state.reference),
new CommitApplyFileChangesCommandQuickPickItem(state.reference, file),
new CommitRestoreFileChangesCommandQuickPickItem(state.reference, file),
);
@ -1746,8 +1753,6 @@ async function getShowCommitOrStashFileStepItems<
);
}
items.push(new RevealInSideBarQuickPickItem(state.reference));
if (isStash) {
items.push(
new CommitBrowseRepositoryFromHereCommandQuickPickItem(state.reference, false),
@ -1758,8 +1763,6 @@ async function getShowCommitOrStashFileStepItems<
);
} else {
items.push(
new SearchForCommitQuickPickItem(state.reference),
new CommitBrowseRepositoryFromHereCommandQuickPickItem(state.reference, false),
new CommitBrowseRepositoryFromHereCommandQuickPickItem(state.reference, true),

+ 3
- 3
src/quickpicks/commitQuickPickItems.ts 查看文件

@ -75,7 +75,7 @@ export class CommitBrowseRepositoryFromHereCommandQuickPickItem extends CommandQ
private readonly openInNewWindow: boolean,
item?: QuickPickItem,
) {
super(item ?? `$(folder-opened) Browse Repository from Here${openInNewWindow ? ' in New Window' : ''}`);
super(item ?? `$(folder-opened) Browse from Here${openInNewWindow ? ' in New Window' : ''}`);
}
execute(_options: { preserveFocus?: boolean; preview?: boolean }): Promise<void> {
@ -105,7 +105,7 @@ export class CommitCompareWithWorkingCommandQuickPickItem extends CommandQuickPi
export class CommitCopyIdQuickPickItem extends CommandQuickPickItem {
constructor(private readonly commit: GitLogCommit, item?: QuickPickItem) {
super(item ?? '$(clippy) Copy Commit ID');
super(item ?? '$(clippy) Copy SHA');
}
execute(): Promise<void> {
@ -114,7 +114,7 @@ export class CommitCopyIdQuickPickItem extends CommandQuickPickItem {
async onDidPressKey(key: Keys): Promise<void> {
await super.onDidPressKey(key);
void window.showInformationMessage('Commit ID copied to the clipboard');
void window.showInformationMessage('Commit SHA copied to the clipboard');
}
}

正在加载...
取消
保存