mirror of
https://github.com/ckaczor/vscode-gitlens.git
synced 2026-01-14 01:25:43 -05:00
Renames explorer views
Adds refresh commands for explorer views Adds context menu commands to both explorer views
This commit is contained in:
67
package.json
67
package.json
@@ -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-explorer && viewItem == commit-file",
|
||||
"when": "gitlens:enabled && view == gitlens.gitExplorer && viewItem == commit-file",
|
||||
"group": "1_gitlens@2"
|
||||
},
|
||||
{
|
||||
"command": "gitlens.diffWithPrevious",
|
||||
"when": "gitlens:enabled && view == gitlens-explorer && viewItem == commit-file",
|
||||
"when": "gitlens:enabled && view == gitlens.gitExplorer && viewItem == commit-file",
|
||||
"group": "2_gitlens@1"
|
||||
},
|
||||
{
|
||||
"command": "gitlens.diffWithWorking",
|
||||
"when": "gitlens:enabled && view == gitlens-explorer && viewItem == commit-file",
|
||||
"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.stashExplorer && viewItem == commit-file",
|
||||
"group": "1_gitlens@2"
|
||||
},
|
||||
{
|
||||
"command": "gitlens.diffWithPrevious",
|
||||
"when": "gitlens:enabled && view == gitlens.stashExplorer && viewItem == commit-file",
|
||||
"group": "2_gitlens@1"
|
||||
},
|
||||
{
|
||||
"command": "gitlens.diffWithWorking",
|
||||
"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"
|
||||
}
|
||||
]
|
||||
|
||||
@@ -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!));
|
||||
}
|
||||
|
||||
|
||||
@@ -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<ExplorerNode> {
|
||||
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)
|
||||
|
||||
@@ -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<ExplorerNode> {
|
||||
}
|
||||
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user