Browse Source

Adds missing "Show * View" commands

main
Eric Amodio 4 years ago
parent
commit
0a40eb0f97
3 changed files with 104 additions and 3 deletions
  1. +63
    -0
      package.json
  2. +8
    -2
      src/commands/common.ts
  3. +33
    -1
      src/commands/showView.ts

+ 63
- 0
package.json View File

@ -2467,6 +2467,21 @@
"category": "GitLens"
},
{
"command": "gitlens.showBranchesView",
"title": "Show Branches View",
"category": "GitLens"
},
{
"command": "gitlens.showCommitsView",
"title": "Show Commits View",
"category": "GitLens"
},
{
"command": "gitlens.showContributorsView",
"title": "Show Contributors View",
"category": "GitLens"
},
{
"command": "gitlens.showFileHistoryView",
"title": "Show File History View",
"category": "GitLens"
@ -2477,6 +2492,11 @@
"category": "GitLens"
},
{
"command": "gitlens.showRemotesView",
"title": "Show Remotes View",
"category": "GitLens"
},
{
"command": "gitlens.showRepositoriesView",
"title": "Show Repositories View",
"category": "GitLens"
@ -2487,6 +2507,21 @@
"category": "GitLens"
},
{
"command": "gitlens.showStashesView",
"title": "Show Stashes View",
"category": "GitLens"
},
{
"command": "gitlens.showTagsView",
"title": "Show Tags View",
"category": "GitLens"
},
{
"command": "gitlens.showWelcomeView",
"title": "Show Welcome View",
"category": "GitLens"
},
{
"command": "gitlens.diffDirectory",
"title": "Directory Compare Working Tree with...",
"category": "GitLens"
@ -4206,6 +4241,18 @@
"when": "false"
},
{
"command": "gitlens.showBranchesView",
"when": "gitlens:enabled"
},
{
"command": "gitlens.showCommitsView",
"when": "gitlens:enabled"
},
{
"command": "gitlens.showContributorsView",
"when": "gitlens:enabled"
},
{
"command": "gitlens.showFileHistoryView",
"when": "gitlens:enabled"
},
@ -4214,6 +4261,10 @@
"when": "gitlens:enabled"
},
{
"command": "gitlens.showRemotesView",
"when": "gitlens:enabled"
},
{
"command": "gitlens.showRepositoriesView",
"when": "gitlens:enabled"
},
@ -4222,6 +4273,18 @@
"when": "gitlens:enabled"
},
{
"command": "gitlens.showStashesView",
"when": "gitlens:enabled"
},
{
"command": "gitlens.showTagsView",
"when": "gitlens:enabled"
},
{
"command": "gitlens.showWelcomeView",
"when": "gitlens:enabled"
},
{
"command": "gitlens.diffDirectory",
"when": "gitlens:enabled"
},

+ 8
- 2
src/commands/common.ts View File

@ -89,12 +89,15 @@ export enum Commands {
SearchCommits = 'gitlens.showCommitSearch',
SearchCommitsInView = 'gitlens.views.searchAndCompare.searchCommits',
SetViewsLayout = 'gitlens.setViewsLayout',
ShowBranchesView = 'gitlens.showBranchesView',
ShowCommitInView = 'gitlens.showCommitInView',
ShowCommitsInView = 'gitlens.showCommitsInView',
ShowCommitsView = 'gitlens.showCommitsView',
ShowContributorsView = 'gitlens.showContributorsView',
ShowFileHistoryView = 'gitlens.showFileHistoryView',
ShowFileHistoryInView = 'gitlens.showFileHistoryInView',
ShowLineHistoryView = 'gitlens.showLineHistoryView',
ShowLastQuickPick = 'gitlens.showLastQuickPick',
ShowLineHistoryView = 'gitlens.showLineHistoryView',
ShowQuickBranchHistory = 'gitlens.showQuickBranchHistory',
ShowQuickCommit = 'gitlens.showQuickCommitDetails',
ShowQuickCommitFile = 'gitlens.showQuickCommitFileDetails',
@ -105,9 +108,9 @@ export enum Commands {
ShowQuickCommitRevisionInDiffLeft = 'gitlens.showQuickRevisionDetailsInDiffLeft',
ShowQuickCommitRevisionInDiffRight = 'gitlens.showQuickRevisionDetailsInDiffRight',
ShowQuickStashList = 'gitlens.showQuickStashList',
ShowRemotesView = 'gitlens.showRemotesView',
ShowRepositoriesView = 'gitlens.showRepositoriesView',
ShowSearchAndCompareView = 'gitlens.showSearchAndCompareView',
ShowHistoryPage = 'gitlens.showHistoryPage',
ShowSettingsPage = 'gitlens.showSettingsPage',
ShowSettingsPageAndJumpToBranchesView = 'gitlens.showSettingsPage#branches-view',
ShowSettingsPageAndJumpToCommitsView = 'gitlens.showSettingsPage#commits-view',
@ -119,7 +122,10 @@ export enum Commands {
ShowSettingsPageAndJumpToSearchAndCompareView = 'gitlens.showSettingsPage#search-compare-view',
ShowSettingsPageAndJumpToStashesView = 'gitlens.showSettingsPage#stashes-view',
ShowSettingsPageAndJumpToTagsView = 'gitlens.showSettingsPage#tags-view',
ShowStashesView = 'gitlens.showStashesView',
ShowTagsView = 'gitlens.showTagsView',
ShowWelcomePage = 'gitlens.showWelcomePage',
ShowWelcomeView = 'gitlens.showWelcomeView',
StashApply = 'gitlens.stashApply',
StashSave = 'gitlens.stashSave',
StashSaveFiles = 'gitlens.stashSaveFiles',

+ 33
- 1
src/commands/showView.ts View File

@ -1,4 +1,6 @@
'use strict';
import { commands } from 'vscode';
import { configuration } from '../configuration';
import { Container } from '../container';
import { command, Command, CommandContext, Commands } from './common';
@ -6,10 +8,17 @@ import { command, Command, CommandContext, Commands } from './common';
export class ShowViewCommand extends Command {
constructor() {
super([
Commands.ShowBranchesView,
Commands.ShowCommitsView,
Commands.ShowContributorsView,
Commands.ShowFileHistoryView,
Commands.ShowLineHistoryView,
Commands.ShowRemotesView,
Commands.ShowRepositoriesView,
Commands.ShowSearchAndCompareView,
Commands.ShowStashesView,
Commands.ShowTagsView,
Commands.ShowWelcomeView,
]);
}
@ -17,16 +26,39 @@ export class ShowViewCommand extends Command {
return this.execute(context.command as Commands);
}
execute(command: Commands) {
async execute(command: Commands) {
switch (command) {
case Commands.ShowBranchesView:
return Container.branchesView.show();
case Commands.ShowCommitsView:
return Container.commitsView.show();
case Commands.ShowContributorsView:
return Container.contributorsView.show();
case Commands.ShowFileHistoryView:
return Container.fileHistoryView.show();
case Commands.ShowLineHistoryView:
if (!Container.config.views.lineHistory.enabled) {
await configuration.updateEffective('views', 'lineHistory', 'enabled', true);
}
return Container.lineHistoryView.show();
case Commands.ShowRemotesView:
return Container.remotesView.show();
case Commands.ShowRepositoriesView:
if (!Container.config.views.lineHistory.enabled) {
await configuration.updateEffective('views', 'repositories', 'enabled', true);
}
return Container.repositoriesView.show();
case Commands.ShowSearchAndCompareView:
return Container.searchAndCompareView.show();
case Commands.ShowStashesView:
return Container.stashesView.show();
case Commands.ShowTagsView:
return Container.tagsView.show();
case Commands.ShowWelcomeView:
if (!Container.config.views.welcome.enabled) {
await configuration.updateEffective('views', 'welcome', 'enabled', true);
}
void (await commands.executeCommand('gitlens.views.welcome.focus'));
}
return Promise.resolve(undefined);

Loading…
Cancel
Save