mirror of
https://github.com/ckaczor/vscode-gitlens.git
synced 2026-02-16 10:58:34 -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",
|
"command": "gitlens.resetSuppressedWarnings",
|
||||||
"title": "Reset Suppressed Warnings",
|
"title": "Reset Suppressed Warnings",
|
||||||
"category": "GitLens"
|
"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": {
|
"menus": {
|
||||||
@@ -1098,6 +1114,14 @@
|
|||||||
{
|
{
|
||||||
"command": "gitlens.resetSuppressedWarnings",
|
"command": "gitlens.resetSuppressedWarnings",
|
||||||
"when": "gitlens:enabled"
|
"when": "gitlens:enabled"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command": "gitlens.gitExplorer.refresh",
|
||||||
|
"when": "gitlens:enabled"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command": "gitlens.stashExplorer.refresh",
|
||||||
|
"when": "gitlens:enabled"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"editor/context": [
|
"editor/context": [
|
||||||
@@ -1275,30 +1299,55 @@
|
|||||||
],
|
],
|
||||||
"view/title": [
|
"view/title": [
|
||||||
{
|
{
|
||||||
"command": "gitlens.showQuickRepoHistory",
|
"command": "gitlens.gitExplorer.refresh",
|
||||||
"when": "gitlens:enabled && view == gitlens-explorer",
|
"when": "gitlens:enabled && view == gitlens.gitExplorer",
|
||||||
"group": "1_gitlens@1"
|
"group": "navigation"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"command": "gitlens.stashExplorer.refresh",
|
||||||
|
"when": "gitlens:enabled && view == gitlens.stashExplorer",
|
||||||
|
"group": "navigation"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"view/item/context": [
|
"view/item/context": [
|
||||||
{
|
{
|
||||||
"command": "gitlens.openCommitInRemote",
|
"command": "gitlens.openCommitInRemote",
|
||||||
"when": "gitlens:enabled && view == gitlens-explorer && viewItem == commit",
|
"when": "gitlens:enabled && view == gitlens.gitExplorer && viewItem == commit",
|
||||||
"group": "1_gitlens@1"
|
"group": "1_gitlens@1"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"command": "gitlens.openFileInRemote",
|
"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"
|
"group": "1_gitlens@2"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"command": "gitlens.diffWithPrevious",
|
"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"
|
"group": "2_gitlens@1"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"command": "gitlens.diffWithWorking",
|
"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"
|
"group": "2_gitlens@2"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -1398,11 +1447,11 @@
|
|||||||
"views": {
|
"views": {
|
||||||
"explorer": [
|
"explorer": [
|
||||||
{
|
{
|
||||||
"id": "gitlens-explorer",
|
"id": "gitlens.gitExplorer",
|
||||||
"name": "GitLens Explorer"
|
"name": "GitLens Explorer"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "gitstash-explorer",
|
"id": "gitlens.stashExplorer",
|
||||||
"name": "Git Stashes"
|
"name": "Git Stashes"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -92,12 +92,12 @@ export async function activate(context: ExtensionContext) {
|
|||||||
let explorer: GitExplorer | undefined = undefined;
|
let explorer: GitExplorer | undefined = undefined;
|
||||||
if (cfg.insiders) {
|
if (cfg.insiders) {
|
||||||
explorer = new GitExplorer(context, git);
|
explorer = new GitExplorer(context, git);
|
||||||
context.subscriptions.push(window.registerTreeDataProvider('gitlens-explorer', explorer));
|
context.subscriptions.push(window.registerTreeDataProvider('gitlens.gitExplorer', explorer));
|
||||||
}
|
}
|
||||||
let stashExplorer;
|
let stashExplorer;
|
||||||
if (cfg.insiders) {
|
if (cfg.insiders) {
|
||||||
stashExplorer = new StashExplorer(context, git);
|
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!));
|
context.subscriptions.push(new ShowStashListCommand(git, stashExplorer!));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
'use strict';
|
'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 { UriComparer } from '../comparers';
|
||||||
import { ExplorerNode, FileHistoryNode, RepositoryNode, ResourceType, StashNode } from './explorerNodes';
|
import { ExplorerNode, FileHistoryNode, RepositoryNode, ResourceType, StashNode } from './explorerNodes';
|
||||||
import { GitService, GitUri } from '../gitService';
|
import { GitService, GitUri } from '../gitService';
|
||||||
@@ -16,6 +16,8 @@ export class GitExplorer implements TreeDataProvider<ExplorerNode> {
|
|||||||
private _roots: ExplorerNode[] = [];
|
private _roots: ExplorerNode[] = [];
|
||||||
|
|
||||||
constructor(private context: ExtensionContext, private git: GitService) {
|
constructor(private context: ExtensionContext, private git: GitService) {
|
||||||
|
commands.registerCommand('gitlens.gitExplorer.refresh', () => this.refresh());
|
||||||
|
|
||||||
const editor = window.activeTextEditor;
|
const editor = window.activeTextEditor;
|
||||||
|
|
||||||
const uri = (editor !== undefined && editor.document !== undefined)
|
const uri = (editor !== undefined && editor.document !== undefined)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
'use strict';
|
'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 { ExplorerNode, StashNode } from './explorerNodes';
|
||||||
import { GitService, GitUri } from '../gitService';
|
import { GitService, GitUri } from '../gitService';
|
||||||
import { StashCommitNode } from './stashCommitNode';
|
import { StashCommitNode } from './stashCommitNode';
|
||||||
@@ -15,6 +15,8 @@ export class StashExplorer implements TreeDataProvider<ExplorerNode> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
constructor(private context: ExtensionContext, private git: GitService) {
|
constructor(private context: ExtensionContext, private git: GitService) {
|
||||||
|
commands.registerCommand('gitlens.stashExplorer.refresh', () => this.refresh());
|
||||||
|
|
||||||
const editor = window.activeTextEditor;
|
const editor = window.activeTextEditor;
|
||||||
|
|
||||||
const uri = (editor !== undefined && editor.document !== undefined)
|
const uri = (editor !== undefined && editor.document !== undefined)
|
||||||
|
|||||||
Reference in New Issue
Block a user