Browse Source

Requires vscode 1.20

Adds inline commands to explorer
main
Eric Amodio 6 years ago
parent
commit
e45f63621b
12 changed files with 78 additions and 15 deletions
  1. +2
    -0
      CHANGELOG.md
  2. +5
    -0
      images/dark/icon-close-small.svg
  3. +4
    -0
      images/dark/icon-open-file.svg
  4. +0
    -0
      images/dark/icon-open-working-file.svg
  5. +5
    -0
      images/light/icon-close-small.svg
  6. +4
    -0
      images/light/icon-open-file.svg
  7. +0
    -0
      images/light/icon-open-working-file.svg
  8. +48
    -5
      package.json
  9. +1
    -1
      src/views/branchFolderNode.ts
  10. +1
    -1
      src/views/folderNode.ts

+ 2
- 0
CHANGELOG.md View File

@ -7,6 +7,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
## [Unreleased] ## [Unreleased]
### Added ### Added
- Adds `gitlens.statusBar.reduceFlicker` setting to specify whether to reduce the status bar "flickering" when changing lines by not first clearing the previous blame information -- closes [#272](https://github.com/eamodio/vscode-gitlens/issues/272) - Adds `gitlens.statusBar.reduceFlicker` setting to specify whether to reduce the status bar "flickering" when changing lines by not first clearing the previous blame information -- closes [#272](https://github.com/eamodio/vscode-gitlens/issues/272)
- Adds the *Open File* (`gitlens.explorers.openFile`) command to the *GitLens* explorer inline for file nodes
- Adds the *Clear Results* (`gitlen.resultsExplorer.clearResultsNode`) command to the *GitLens Results* view inline for results nodes
### Fixed ### Fixed
- Fixes [#276](https://github.com/eamodio/vscode-gitlens/issues/276) - Lookup for branches without upstreams fails - Fixes [#276](https://github.com/eamodio/vscode-gitlens/issues/276) - Lookup for branches without upstreams fails

+ 5
- 0
images/dark/icon-close-small.svg View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<svg width="16" height="22" xmlns="http://www.w3.org/2000/svg">
<path fill="none" d="M-1-1h582v402H-1z"/>
<path fill="#C5C5C5" stroke="null" d="M9 11l3 3-1 1-3-3-3 3-1-1 3-3-3-3 1-1 3 3 3-3 1 1-3 3z" />
</svg>

+ 4
- 0
images/dark/icon-open-file.svg View File

@ -0,0 +1,4 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16">
<polygon fill="#C5C5C5" points="10,2 7.414,2 8.414,3 9,3 9,3.586 9,4 9,4.414 9,6 12,6 12,13 4,13 4,8 3,8 3,14 13,14 13,5"/>'
<polygon fill="#C5C5C5" points="5,1 3,1 5,3 1,3 1,5 5,5 3,7 5,7 8,4"/>
</svg>

images/dark/open-file.svg → images/dark/icon-open-working-file.svg View File


+ 5
- 0
images/light/icon-close-small.svg View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<svg width="16" height="22" xmlns="http://www.w3.org/2000/svg">
<path fill="none" d="M-1-1h582v402H-1z"/>
<path fill="#424242" stroke="null" d="M9 11l3 3-1 1-3-3-3 3-1-1 3-3-3-3 1-1 3 3 3-3 1 1-3 3z" />
</svg>

+ 4
- 0
images/light/icon-open-file.svg View File

@ -0,0 +1,4 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16">
<polygon fill="#424242" points="10,2 7.414,2 8.414,3 9,3 9,3.586 9,4 9,4.414 9,6 12,6 12,13 4,13 4,8 3,8 3,14 13,14 13,5"/>'
<polygon fill="#424242" points="5,1 3,1 5,3 1,3 1,5 5,5 3,7 5,7 8,4"/>
</svg>

images/light/open-file.svg → images/light/icon-open-working-file.svg View File


+ 48
- 5
package.json View File

@ -7,7 +7,7 @@
}, },
"publisher": "eamodio", "publisher": "eamodio",
"engines": { "engines": {
"vscode": "^1.19.0"
"vscode": "^1.20.0"
}, },
"license": "SEE LICENSE IN LICENSE", "license": "SEE LICENSE IN LICENSE",
"displayName": "GitLens \u2014 Git supercharged", "displayName": "GitLens \u2014 Git supercharged",
@ -1306,8 +1306,8 @@
"title": "Open Working File", "title": "Open Working File",
"category": "GitLens", "category": "GitLens",
"icon": { "icon": {
"dark": "images/dark/open-file.svg",
"light": "images/light/open-file.svg"
"dark": "images/dark/icon-open-working-file.svg",
"light": "images/light/icon-open-working-file.svg"
} }
}, },
{ {
@ -1367,7 +1367,11 @@
{ {
"command": "gitlens.explorers.openFile", "command": "gitlens.explorers.openFile",
"title": "Open File", "title": "Open File",
"category": "GitLens"
"category": "GitLens",
"icon": {
"dark": "images/dark/icon-open-file.svg",
"light": "images/light/icon-open-file.svg"
}
}, },
{ {
"command": "gitlens.explorers.openFileRevision", "command": "gitlens.explorers.openFileRevision",
@ -1574,7 +1578,11 @@
{ {
"command": "gitlens.resultsExplorer.clearResultsNode", "command": "gitlens.resultsExplorer.clearResultsNode",
"title": "Clear Results", "title": "Clear Results",
"category": "GitLens"
"category": "GitLens",
"icon": {
"dark": "images/dark/icon-close-small.svg",
"light": "images/light/icon-close-small.svg"
}
}, },
{ {
"command": "gitlens.resultsExplorer.close", "command": "gitlens.resultsExplorer.close",
@ -2797,6 +2805,11 @@
"group": "8_gitlens@5" "group": "8_gitlens@5"
}, },
{ {
"command": "gitlens.explorers.openFile",
"when": "viewItem == gitlens:commit-file",
"group": "inline"
},
{
"command": "gitlens.explorers.openChanges", "command": "gitlens.explorers.openChanges",
"when": "viewItem == gitlens:commit-file", "when": "viewItem == gitlens:commit-file",
"group": "1_gitlens@1" "group": "1_gitlens@1"
@ -2844,6 +2857,11 @@
{ {
"command": "gitlens.explorers.openFile", "command": "gitlens.explorers.openFile",
"when": "viewItem == gitlens:file-history", "when": "viewItem == gitlens:file-history",
"group": "inline"
},
{
"command": "gitlens.explorers.openFile",
"when": "viewItem == gitlens:file-history",
"group": "1_gitlens@1" "group": "1_gitlens@1"
}, },
{ {
@ -2874,6 +2892,11 @@
{ {
"command": "gitlens.resultsExplorer.clearResultsNode", "command": "gitlens.resultsExplorer.clearResultsNode",
"when": "viewItem == gitlens:comparison-results", "when": "viewItem == gitlens:comparison-results",
"group": "inline"
},
{
"command": "gitlens.resultsExplorer.clearResultsNode",
"when": "viewItem == gitlens:comparison-results",
"group": "1_gitlens@1" "group": "1_gitlens@1"
}, },
{ {
@ -2884,6 +2907,11 @@
{ {
"command": "gitlens.resultsExplorer.clearResultsNode", "command": "gitlens.resultsExplorer.clearResultsNode",
"when": "viewItem == gitlens:search-results", "when": "viewItem == gitlens:search-results",
"group": "inline"
},
{
"command": "gitlens.resultsExplorer.clearResultsNode",
"when": "viewItem == gitlens:search-results",
"group": "1_gitlens@1" "group": "1_gitlens@1"
}, },
{ {
@ -2947,6 +2975,11 @@
"group": "7_gitlens_@2" "group": "7_gitlens_@2"
}, },
{ {
"command": "gitlens.explorers.openFile",
"when": "viewItem == gitlens:stash-file",
"group": "inline"
},
{
"command": "gitlens.explorers.applyChanges", "command": "gitlens.explorers.applyChanges",
"when": "viewItem == gitlens:stash-file", "when": "viewItem == gitlens:stash-file",
"group": "1_gitlens@1" "group": "1_gitlens@1"
@ -2987,6 +3020,11 @@
"group": "1_gitlens@1" "group": "1_gitlens@1"
}, },
{ {
"command": "gitlens.explorers.openFile",
"when": "viewItem == gitlens:status-file",
"group": "inline"
},
{
"command": "gitlens.explorers.openChanges", "command": "gitlens.explorers.openChanges",
"when": "viewItem == gitlens:status-file", "when": "viewItem == gitlens:status-file",
"group": "1_gitlens@1" "group": "1_gitlens@1"
@ -3023,6 +3061,11 @@
}, },
{ {
"command": "gitlens.explorers.openFile", "command": "gitlens.explorers.openFile",
"when": "viewItem == gitlens:stash-file-commits",
"group": "inline"
},
{
"command": "gitlens.explorers.openFile",
"when": "viewItem == gitlens:status-file-commits", "when": "viewItem == gitlens:status-file-commits",
"group": "1_gitlens@1" "group": "1_gitlens@1"
}, },

+ 1
- 1
src/views/branchFolderNode.ts View File

@ -37,7 +37,7 @@ export class BranchFolderNode extends ExplorerNode {
async getTreeItem(): Promise<TreeItem> { async getTreeItem(): Promise<TreeItem> {
const item = new TreeItem(this.label, TreeItemCollapsibleState.Collapsed); const item = new TreeItem(this.label, TreeItemCollapsibleState.Collapsed);
item.contextValue = ResourceType.Folder; item.contextValue = ResourceType.Folder;
(item as any).resourceUri = this.explorer.folderResourceUri;
item.resourceUri = this.explorer.folderResourceUri;
return item; return item;
} }

+ 1
- 1
src/views/folderNode.ts View File

@ -63,7 +63,7 @@ export class FolderNode extends ExplorerNode {
// TODO: Change this to expanded once https://github.com/Microsoft/vscode/issues/30918 is fixed // TODO: Change this to expanded once https://github.com/Microsoft/vscode/issues/30918 is fixed
const item = new TreeItem(this.label, TreeItemCollapsibleState.Collapsed); const item = new TreeItem(this.label, TreeItemCollapsibleState.Collapsed);
item.contextValue = ResourceType.Folder; item.contextValue = ResourceType.Folder;
(item as any).resourceUri = this.explorer.folderResourceUri;
item.resourceUri = this.explorer.folderResourceUri;
return item; return item;
} }

Loading…
Cancel
Save