Parcourir la source

Renames explorer views

Adds refresh commands for explorer views
Adds context menu commands to both explorer views
main
Eric Amodio il y a 7 ans
Parent
révision
6410a274d5
4 fichiers modifiés avec 66 ajouts et 13 suppressions
  1. +58
    -9
      package.json
  2. +2
    -2
      src/extension.ts
  3. +3
    -1
      src/views/gitExplorer.ts
  4. +3
    -1
      src/views/stashExplorer.ts

+ 58
- 9
package.json Voir le fichier

@ -951,6 +951,22 @@
"command": "gitlens.resetSuppressedWarnings",
"title": "Reset Suppressed Warnings",
"category": "GitLens"
},
{
"command": "gitlens.gitExplorer.refresh",
"title": "Refresh",
"icon": {
"dark": "images/dark/icon-refresh.svg",
"light": "images/light/icon-refresh.svg"
}
},
{
"command": "gitlens.stashExplorer.refresh",
"title": "Refresh",
"icon": {
"dark": "images/dark/icon-refresh.svg",
"light": "images/light/icon-refresh.svg"
}
}
],
"menus": {
@ -1098,6 +1114,14 @@
{
"command": "gitlens.resetSuppressedWarnings",
"when": "gitlens:enabled"
},
{
"command": "gitlens.gitExplorer.refresh",
"when": "gitlens:enabled"
},
{
"command": "gitlens.stashExplorer.refresh",
"when": "gitlens:enabled"
}
],
"editor/context": [
@ -1275,30 +1299,55 @@
],
"view/title": [
{
"command": "gitlens.showQuickRepoHistory",
"when": "gitlens:enabled && view == gitlens-explorer",
"group": "1_gitlens@1"
"command": "gitlens.gitExplorer.refresh",
"when": "gitlens:enabled && view == gitlens.gitExplorer",
"group": "navigation"
},
{
"command": "gitlens.stashExplorer.refresh",
"when": "gitlens:enabled && view == gitlens.stashExplorer",
"group": "navigation"
}
],
"view/item/context": [
{
"command": "gitlens.openCommitInRemote",
"when": "gitlens:enabled && view == gitlens-explorer && viewItem == commit",
"when": "gitlens:enabled && view == gitlens.gitExplorer && viewItem == commit",
"group": "1_gitlens@1"
},
{
"command": "gitlens.openFileInRemote",
"when": "gitlens:enabled && view == gitlens.gitExplorer && viewItem == commit-file",
"group": "1_gitlens@2"
},
{
"command": "gitlens.diffWithPrevious",
"when": "gitlens:enabled && view == gitlens.gitExplorer && viewItem == commit-file",
"group": "2_gitlens@1"
},
{
"command": "gitlens.diffWithWorking",
"when": "gitlens:enabled && view == gitlens.gitExplorer && viewItem == commit-file",
"group": "2_gitlens@2"
},
{
"command": "gitlens.openCommitInRemote",
"when": "gitlens:enabled && view == gitlens.stashExplorer && viewItem == stash-commit",
"group": "1_gitlens@1"
},
{
"command": "gitlens.openFileInRemote",
"when": "gitlens:enabled && view == gitlens-explorer && viewItem == commit-file",
"when": "gitlens:enabled && view == gitlens.stashExplorer && viewItem == commit-file",
"group": "1_gitlens@2"
},
{
"command": "gitlens.diffWithPrevious",
"when": "gitlens:enabled && view == gitlens-explorer && viewItem == commit-file",
"when": "gitlens:enabled && view == gitlens.stashExplorer && viewItem == commit-file",
"group": "2_gitlens@1"
},
{
"command": "gitlens.diffWithWorking",
"when": "gitlens:enabled && view == gitlens-explorer && viewItem == commit-file",
"when": "gitlens:enabled && view == gitlens.stashExplorer && viewItem == commit-file",
"group": "2_gitlens@2"
}
]
@ -1398,11 +1447,11 @@
"views": {
"explorer": [
{
"id": "gitlens-explorer",
"id": "gitlens.gitExplorer",
"name": "GitLens Explorer"
},
{
"id": "gitstash-explorer",
"id": "gitlens.stashExplorer",
"name": "Git Stashes"
}
]

+ 2
- 2
src/extension.ts Voir le fichier

@ -92,12 +92,12 @@ export async function activate(context: ExtensionContext) {
let explorer: GitExplorer | undefined = undefined;
if (cfg.insiders) {
explorer = new GitExplorer(context, git);
context.subscriptions.push(window.registerTreeDataProvider('gitlens-explorer', explorer));
context.subscriptions.push(window.registerTreeDataProvider('gitlens.gitExplorer', explorer));
}
let stashExplorer;
if (cfg.insiders) {
stashExplorer = new StashExplorer(context, git);
context.subscriptions.push(window.registerTreeDataProvider('gitstash-explorer', stashExplorer));
context.subscriptions.push(window.registerTreeDataProvider('gitlens.stashExplorer', stashExplorer));
context.subscriptions.push(new ShowStashListCommand(git, stashExplorer!));
}

+ 3
- 1
src/views/gitExplorer.ts Voir le fichier

@ -1,5 +1,5 @@
'use strict';
import { Event, EventEmitter, ExtensionContext, TreeDataProvider, TreeItem, Uri, window } from 'vscode';
import { commands, Event, EventEmitter, ExtensionContext, TreeDataProvider, TreeItem, Uri, window } from 'vscode';
import { UriComparer } from '../comparers';
import { ExplorerNode, FileHistoryNode, RepositoryNode, ResourceType, StashNode } from './explorerNodes';
import { GitService, GitUri } from '../gitService';
@ -16,6 +16,8 @@ export class GitExplorer implements TreeDataProvider {
private _roots: ExplorerNode[] = [];
constructor(private context: ExtensionContext, private git: GitService) {
commands.registerCommand('gitlens.gitExplorer.refresh', () => this.refresh());
const editor = window.activeTextEditor;
const uri = (editor !== undefined && editor.document !== undefined)

+ 3
- 1
src/views/stashExplorer.ts Voir le fichier

@ -1,5 +1,5 @@
'use strict';
import { Event, EventEmitter, ExtensionContext, TreeDataProvider, TreeItem, Uri, window } from 'vscode';
import { commands, Event, EventEmitter, ExtensionContext, TreeDataProvider, TreeItem, Uri, window } from 'vscode';
import { ExplorerNode, StashNode } from './explorerNodes';
import { GitService, GitUri } from '../gitService';
import { StashCommitNode } from './stashCommitNode';
@ -15,6 +15,8 @@ export class StashExplorer implements TreeDataProvider {
}
constructor(private context: ExtensionContext, private git: GitService) {
commands.registerCommand('gitlens.stashExplorer.refresh', () => this.refresh());
const editor = window.activeTextEditor;
const uri = (editor !== undefined && editor.document !== undefined)

Chargement…
Annuler
Enregistrer