소스 검색

Renames explorer views

Adds refresh commands for explorer views
Adds context menu commands to both explorer views
main
Eric Amodio 7 년 전
부모
커밋
6410a274d5
4개의 변경된 파일66개의 추가작업 그리고 13개의 파일을 삭제
  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 파일 보기

@ -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 파일 보기

@ -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 파일 보기

@ -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 파일 보기

@ -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)

불러오는 중...
취소
저장