From 4b0a7a0442a5c0a713d7e72ee0eb6d50d5145665 Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Wed, 18 Sep 2019 00:54:34 -0400 Subject: [PATCH] Aligns terminology and settings --- README.md | 16 +++++------ package.json | 8 +++--- src/commands/git/search.ts | 54 ++++++++++++++++++----------------- src/commands/git/stash.ts | 2 +- src/commands/searchCommits.ts | 2 +- src/config.ts | 2 +- src/git/formatters/commitFormatter.ts | 2 +- src/quickpicks/commonQuickPicks.ts | 6 ++-- 8 files changed, 47 insertions(+), 45 deletions(-) diff --git a/README.md b/README.md index 5574c3d..8cc7734 100644 --- a/README.md +++ b/README.md @@ -832,14 +832,14 @@ See also [View Settings](#view-settings- 'Jump to the View settings') ### Git Commands Menu Settings [#](#git-commands-menu-settings- 'Git Commands Menu Settings') -| Name | Description | -| --------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | -| `gitlens.gitCommands.closeOnFocusOut` | Specifies whether to dismiss the Git Commands menu when focus is lost (if not, press `ESC` to dismiss) | -| `gitlens.gitCommands.search.matchAll` | Specifies whether to match all or any commit message search patterns | -| `gitlens.gitCommands.search.matchCase` | Specifies whether to match commit search patterns with or without regard to casing | -| `gitlens.gitCommands.search.matchRegex` | Specifies whether to match commit search patterns using regular expressions | -| `gitlens.gitCommands.search.showInView` | Specifies whether to show the results of a commit search in the _Search Commits_ view or directly within the quick pick menu | -| `gitlens.gitCommands.skipConfirmations` | Specifies which (and when) Git commands will skip the confirmation step, using the format: `git-command-name:(menu|command)` | +| Name | Description | +| ---------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | +| `gitlens.gitCommands.closeOnFocusOut` | Specifies whether to dismiss the Git Commands menu when focus is lost (if not, press `ESC` to dismiss) | +| `gitlens.gitCommands.search.matchAll` | Specifies whether to match all or any commit message search patterns | +| `gitlens.gitCommands.search.matchCase` | Specifies whether to match commit search patterns with or without regard to casing | +| `gitlens.gitCommands.search.matchRegex` | Specifies whether to match commit search patterns using regular expressions | +| `gitlens.gitCommands.search.showResultsInView` | Specifies whether to show the commit search results in the _Search Commits_ view or directly within the quick pick menu | +| `gitlens.gitCommands.skipConfirmations` | Specifies which (and when) Git commands will skip the confirmation step, using the format: `git-command-name:(menu|command)` | ### Date & Time Settings [#](#date--time-settings- 'Date & Time Settings') diff --git a/package.json b/package.json index 4c15a9a..2c961f0 100644 --- a/package.json +++ b/package.json @@ -505,10 +505,10 @@ "markdownDescription": "Specifies whether to match commit search patterns using regular expressions", "scope": "window" }, - "gitlens.gitCommands.search.showInView": { + "gitlens.gitCommands.search.showResultsInView": { "type": "boolean", "default": true, - "markdownDescription": "Specifies whether to show the results of a commit search in the _Search Commits_ view or directly within the quick pick menu", + "markdownDescription": "Specifies whether to show the commit search results in the _Search Commits_ view or directly within the quick pick menu", "scope": "window" }, "gitlens.gitCommands.skipConfirmations": { @@ -2228,12 +2228,12 @@ }, { "command": "gitlens.showCommitInView", - "title": "Open in Search Commits View", + "title": "Show Commit in Search Commits View", "category": "GitLens" }, { "command": "gitlens.showFileHistoryInView", - "title": "Open in File History View", + "title": "Show in File History View", "category": "GitLens" }, { diff --git a/src/commands/git/search.ts b/src/commands/git/search.ts index 3c78ff8..4d6c4ba 100644 --- a/src/commands/git/search.ts +++ b/src/commands/git/search.ts @@ -25,7 +25,7 @@ import { interface State extends Required { repo: Repository; - showInView: boolean; + showResultsInView: boolean; } export interface SearchGitCommandArgs { @@ -100,31 +100,31 @@ export class SearchGitCommand extends QuickCommandBase { tooltip: 'Match using Regular Expressions' }; - static readonly OpenInView: QuickInputButton = { - iconPath: { - dark: Container.context.asAbsolutePath('images/dark/icon-open.svg') as any, - light: Container.context.asAbsolutePath('images/light/icon-open.svg') as any - }, - tooltip: 'Open in Search Commits View' - }; - static readonly RevealInView: QuickInputButton = { iconPath: { dark: Container.context.asAbsolutePath('images/dark/icon-eye.svg') as any, light: Container.context.asAbsolutePath('images/light/icon-eye.svg') as any }, - tooltip: 'Reveal in Repositories View' + tooltip: 'Reveal Commit in Repositories View' }; static readonly ShowInView: QuickInputButton = { iconPath: { + dark: Container.context.asAbsolutePath('images/dark/icon-open.svg') as any, + light: Container.context.asAbsolutePath('images/light/icon-open.svg') as any + }, + tooltip: 'Show Commit in Search Commits View' + }; + + static readonly ShowResultsInView: QuickInputButton = { + iconPath: { dark: Container.context.asAbsolutePath('images/dark/icon-eye.svg') as any, light: Container.context.asAbsolutePath('images/light/icon-eye.svg') as any }, tooltip: 'Show Results in Search Commits View' }; - static readonly ShowInViewSelected: QuickInputButton = { + static readonly ShowResultsInViewSelected: QuickInputButton = { iconPath: { dark: Container.context.asAbsolutePath('images/dark/icon-eye-selected.svg') as any, light: Container.context.asAbsolutePath('images/light/icon-eye-selected.svg') as any @@ -181,8 +181,8 @@ export class SearchGitCommand extends QuickCommandBase { if (state.matchRegex === undefined) { state.matchRegex = cfg.matchRegex; } - if (state.showInView === undefined) { - state.showInView = cfg.showInView; + if (state.showResultsInView === undefined) { + state.showResultsInView = cfg.showResultsInView; } while (true) { @@ -260,8 +260,10 @@ export class SearchGitCommand extends QuickCommandBase { const matchRegexButton: Mutable = { ...(state.matchRegex ? this.Buttons.MatchRegexSelected : this.Buttons.MatchRegex) }; - const showInViewButton: Mutable = { - ...(state.showInView ? this.Buttons.ShowInViewSelected : this.Buttons.ShowInView) + const showResultsInViewButton: Mutable = { + ...(state.showResultsInView + ? this.Buttons.ShowResultsInViewSelected + : this.Buttons.ShowResultsInView) }; const step = this.createPickStep>({ @@ -269,7 +271,7 @@ export class SearchGitCommand extends QuickCommandBase { placeholder: 'e.g. "Updates dependencies" author:eamodio', matchOnDescription: true, matchOnDetail: true, - additionalButtons: [matchCaseButton, matchAllButton, matchRegexButton, showInViewButton], + additionalButtons: [matchCaseButton, matchAllButton, matchRegexButton, showResultsInViewButton], items: items, value: state.pattern, onDidAccept: (quickpick): boolean => { @@ -315,11 +317,11 @@ export class SearchGitCommand extends QuickCommandBase { return; } - if (button === showInViewButton) { - state.showInView = !state.showInView; - showInViewButton.iconPath = state.showInView - ? this.Buttons.ShowInViewSelected.iconPath - : this.Buttons.ShowInView.iconPath; + if (button === showResultsInViewButton) { + state.showResultsInView = !state.showResultsInView; + showResultsInViewButton.iconPath = state.showResultsInView + ? this.Buttons.ShowResultsInViewSelected.iconPath + : this.Buttons.ShowResultsInView.iconPath; } }, onDidChangeValue: (quickpick): boolean => { @@ -371,7 +373,7 @@ export class SearchGitCommand extends QuickCommandBase { resultsKey = searchKey; } - if (state.showInView) { + if (state.showResultsInView) { void Container.searchView.search( state.repo.path, search, @@ -411,9 +413,9 @@ export class SearchGitCommand extends QuickCommandBase { ) ) ], - additionalButtons: [this.Buttons.RevealInView, this.Buttons.OpenInView], + additionalButtons: [this.Buttons.RevealInView, this.Buttons.ShowInView], onDidClickButton: (quickpick, button) => { - if (button === this.Buttons.OpenInView) { + if (button === this.Buttons.ShowInView) { void Container.searchView.search( state.repo!.path, search, @@ -481,9 +483,9 @@ export class SearchGitCommand extends QuickCommandBase { items: await CommitQuickPick.getItems(pickedCommit, pickedCommit.toGitUri(), { showChanges: false }), - additionalButtons: [this.Buttons.RevealInView, this.Buttons.OpenInView], + additionalButtons: [this.Buttons.RevealInView, this.Buttons.ShowInView], onDidClickButton: (quickpick, button) => { - if (button === this.Buttons.OpenInView) { + if (button === this.Buttons.ShowInView) { void Container.searchView.search( pickedCommit!.repoPath, { pattern: SearchPattern.fromCommit(pickedCommit!) }, diff --git a/src/commands/git/stash.ts b/src/commands/git/stash.ts index 8b17fea..cc3d294 100644 --- a/src/commands/git/stash.ts +++ b/src/commands/git/stash.ts @@ -87,7 +87,7 @@ export class StashGitCommand extends QuickCommandBase { dark: Container.context.asAbsolutePath('images/dark/icon-eye.svg') as any, light: Container.context.asAbsolutePath('images/light/icon-eye.svg') as any }, - tooltip: 'Reveal in Repositories View' + tooltip: 'Reveal Stash in Repositories View' }; }; diff --git a/src/commands/searchCommits.ts b/src/commands/searchCommits.ts index 201fa58..b46ba89 100644 --- a/src/commands/searchCommits.ts +++ b/src/commands/searchCommits.ts @@ -57,7 +57,7 @@ export class SearchCommitsCommand extends Command { state: { repo: repo, ...args.search, - showInView: args.showInView + showResultsInView: args.showInView } }; return commands.executeCommand(Commands.GitCommands, gitCommandArgs); diff --git a/src/config.ts b/src/config.ts index dbaa613..fb5a894 100644 --- a/src/config.ts +++ b/src/config.ts @@ -38,7 +38,7 @@ export interface Config { matchAll: boolean; matchCase: boolean; matchRegex: boolean; - showInView: boolean; + showResultsInView: boolean; }; skipConfirmations: string[]; }; diff --git a/src/git/formatters/commitFormatter.ts b/src/git/formatters/commitFormatter.ts index b4be354..b0e96dd 100644 --- a/src/git/formatters/commitFormatter.ts +++ b/src/git/formatters/commitFormatter.ts @@ -230,7 +230,7 @@ export class CommitFormatter extends Formatter { if (this._options.remotes !== undefined && this._options.remotes.length !== 0) { commands += `**[\` ${GlyphChars.ArrowUpRight} \`](${OpenCommitInRemoteCommand.getMarkdownCommandArgs( this._item.sha - )} "Open in Remote")** `; + )} "Open on Remote")** `; } if (this._item.author !== 'You') { diff --git a/src/quickpicks/commonQuickPicks.ts b/src/quickpicks/commonQuickPicks.ts index 830e80c..3902e64 100644 --- a/src/quickpicks/commonQuickPicks.ts +++ b/src/quickpicks/commonQuickPicks.ts @@ -102,7 +102,7 @@ export class OpenInSearchCommitsViewQuickPickItem extends CommandQuickPickItem { constructor( public readonly commit: GitLogCommit, item: QuickPickItem = { - label: '$(link-external) Open in Search Commits View', + label: '$(link-external) Show Commit in Search Commits View', description: '' } ) { @@ -129,7 +129,7 @@ export class OpenInFileHistoryViewQuickPickItem extends CommandQuickPickItem { public readonly uri: GitUri, public readonly baseRef: string | undefined, item: QuickPickItem = { - label: '$(eye) Open in File History View', + label: '$(eye) Show in File History View', description: 'shows the file history in the File History view' } ) { @@ -145,7 +145,7 @@ export class RevealInRepositoriesViewQuickPickItem extends CommandQuickPickItem constructor( public readonly commit: GitLogCommit | GitStashCommit, item: QuickPickItem = { - label: '$(eye) Reveal in Repositories View', + label: '$(eye) Reveal Commit in Repositories View', description: `${commit.isStash ? '' : `${GlyphChars.Dash} this can take a while`}` } ) {