Bladeren bron

Adds open in remote / copy remote url to many node toolbars

main
Eric Amodio 6 jaren geleden
bovenliggende
commit
154f269e12
7 gewijzigde bestanden met toevoegingen van 93 en 25 verwijderingen
  1. +5
    -0
      images/dark/icon-copy-remote.svg
  2. +4
    -0
      images/dark/icon-link.svg
  3. +5
    -0
      images/light/icon-copy-remote.svg
  4. +4
    -0
      images/light/icon-link.svg
  5. +70
    -21
      package.json
  6. +1
    -1
      src/views/nodes/lineHistoryNode.ts
  7. +4
    -3
      src/views/nodes/viewNode.ts

+ 5
- 0
images/dark/icon-copy-remote.svg Bestand weergeven

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 22">
<path fill="#C5C5C5" d="M12.889 6.177L12.9 10.5h-1.4l.029-4.154a.17.17 0 0 0-.172-.169h-1.189v.453c0 .726-5.445.756-5.445 0v-.453H3.532a.17.17 0 0 0-.171.169v9.643c0 .094.076.17.171.17L5 16.2v1.3l-1.639.019A1.361 1.361 0 0 1 2 16.159V6.177c0-.752.61-1.362 1.361-1.362H5.63a1.816 1.816 0 0 1 3.631 0h2.268c.751 0 1.36.61 1.36 1.362zM6.765 4.815a.68.68 0 1 0 1.36 0 .68.68 0 0 0-1.36 0z"/>
<path fill="#C5C5C5" d="M12.917 16.666h.583v1.75a.585.585 0 0 1-.583.584H7.084a.586.586 0 0 1-.584-.584v-5.833c0-.321.263-.583.584-.583h1.75v.583h-1.75v5.833h5.833v-1.75zM10 12l1.313 1.312-1.896 1.896.875.875 1.896-1.896L13.5 15.5V12H10z"/>
</svg>

+ 4
- 0
images/dark/icon-link.svg Bestand weergeven

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 22">
<path fill="#C5C5C5" d="M13 13h1v3c0 .55-.45 1-1 1H3c-.55 0-1-.45-1-1V6c0-.55.45-1 1-1h3v1H3v10h10v-3zM8 5l2.25 2.25L7 10.5 8.5 12l3.25-3.25L14 11V5H8z"/>
</svg>

+ 5
- 0
images/light/icon-copy-remote.svg Bestand weergeven

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 22">
<path fill="#424242" d="M12.889 6.177L12.9 10.5h-1.4l.029-4.154a.17.17 0 0 0-.172-.169h-1.189v.453c0 .726-5.445.756-5.445 0v-.453H3.532a.17.17 0 0 0-.171.169v9.643c0 .094.076.17.171.17L5 16.2v1.3l-1.639.019A1.361 1.361 0 0 1 2 16.159V6.177c0-.752.61-1.362 1.361-1.362H5.63a1.816 1.816 0 0 1 3.631 0h2.268c.751 0 1.36.61 1.36 1.362zM6.765 4.815a.68.68 0 1 0 1.36 0 .68.68 0 0 0-1.36 0z"/>
<path fill="#424242" d="M12.917 16.666h.583v1.75a.585.585 0 0 1-.583.584H7.084a.586.586 0 0 1-.584-.584v-5.833c0-.321.263-.583.584-.583h1.75v.583h-1.75v5.833h5.833v-1.75zM10 12l1.313 1.312-1.896 1.896.875.875 1.896-1.896L13.5 15.5V12H10z"/>
</svg>

+ 4
- 0
images/light/icon-link.svg Bestand weergeven

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 22">
<path fill="#424242" d="M13 13h1v3c0 .55-.45 1-1 1H3c-.55 0-1-.45-1-1V6c0-.55.45-1 1-1h3v1H3v10h10v-3zM8 5l2.25 2.25L7 10.5 8.5 12l3.25-3.25L14 11V5H8z"/>
</svg>

+ 70
- 21
package.json Bestand weergeven

@ -1768,7 +1768,11 @@
{
"command": "gitlens.copyRemoteFileUrlToClipboard",
"title": "Copy Remote File Url to Clipboard",
"category": "GitLens"
"category": "GitLens",
"icon": {
"dark": "images/dark/icon-copy-remote.svg",
"light": "images/light/icon-copy-remote.svg"
}
},
{
"command": "gitlens.copyShaToClipboard",
@ -1792,22 +1796,38 @@
{
"command": "gitlens.openBranchesInRemote",
"title": "Open Branches on Remote",
"category": "GitLens"
"category": "GitLens",
"icon": {
"dark": "images/dark/icon-link.svg",
"light": "images/light/icon-link.svg"
}
},
{
"command": "gitlens.openBranchInRemote",
"title": "Open Branch on Remote",
"category": "GitLens"
"category": "GitLens",
"icon": {
"dark": "images/dark/icon-link.svg",
"light": "images/light/icon-link.svg"
}
},
{
"command": "gitlens.openCommitInRemote",
"title": "Open Commit on Remote",
"category": "GitLens"
"category": "GitLens",
"icon": {
"dark": "images/dark/icon-link.svg",
"light": "images/light/icon-link.svg"
}
},
{
"command": "gitlens.openFileInRemote",
"title": "Open File on Remote",
"category": "GitLens"
"category": "GitLens",
"icon": {
"dark": "images/dark/icon-link.svg",
"light": "images/light/icon-link.svg"
}
},
{
"command": "gitlens.openFileRevision",
@ -1817,7 +1837,11 @@
{
"command": "gitlens.openRepoInRemote",
"title": "Open Repository on Remote",
"category": "GitLens"
"category": "GitLens",
"icon": {
"dark": "images/dark/icon-link.svg",
"light": "images/light/icon-link.svg"
}
},
{
"command": "gitlens.openWorkingFile",
@ -1980,7 +2004,11 @@
{
"command": "gitlens.views.openFileRevisionInRemote",
"title": "Open Revision on Remote",
"category": "GitLens"
"category": "GitLens",
"icon": {
"dark": "images/dark/icon-link.svg",
"light": "images/light/icon-link.svg"
}
},
{
"command": "gitlens.views.openChangedFiles",
@ -3206,11 +3234,21 @@
{
"command": "gitlens.openBranchesInRemote",
"when": "viewItem == gitlens:branches:remotes",
"group": "inline@98"
},
{
"command": "gitlens.openBranchesInRemote",
"when": "viewItem == gitlens:branches:remotes",
"group": "1_gitlens@1"
},
{
"command": "gitlens.openBranchInRemote",
"when": "viewItem =~ /gitlens:(branch\\b(.*?:tracking|:remote))/",
"group": "inline@98"
},
{
"command": "gitlens.openBranchInRemote",
"when": "viewItem =~ /gitlens:(branch\\b(.*?:tracking|:remote))/",
"group": "1_gitlens@1"
},
{
@ -3291,6 +3329,11 @@
{
"command": "gitlens.openCommitInRemote",
"when": "viewItem =~ /gitlens:commit\\b/ && gitlens:hasRemotes",
"group": "inline@98"
},
{
"command": "gitlens.openCommitInRemote",
"when": "viewItem =~ /gitlens:commit\\b/ && gitlens:hasRemotes",
"group": "1_gitlens@1"
},
{
@ -3371,18 +3414,18 @@
},
{
"command": "gitlens.views.openFile",
"when": "viewItem =~ /gitlens:(file|history-file|status:file)\\b/",
"group": "inline"
"when": "viewItem =~ /gitlens:(file|history:(file|line)|status:file)\\b/",
"group": "inline@1"
},
{
"command": "gitlens.views.stageFile",
"when": "viewItem =~ /gitlens:file\\b.*:unstaged\\b/",
"group": "inline"
"group": "inline@1"
},
{
"command": "gitlens.views.unstageFile",
"when": "viewItem =~ /gitlens:file\\b.*:staged\\b/",
"group": "inline"
"group": "inline@1"
},
{
"command": "gitlens.views.stageFile",
@ -3416,7 +3459,7 @@
},
{
"command": "gitlens.views.openFile",
"when": "viewItem =~ /gitlens:(file|history-file|status:file)\\b/",
"when": "viewItem =~ /gitlens:(file|history:(file|line)|status:file)\\b/",
"group": "3_gitlens@1"
},
{
@ -3426,12 +3469,18 @@
},
{
"command": "gitlens.openFileInRemote",
"when": "viewItem =~ /gitlens:(file(?!:(un)?staged)|history:(file|line))\\b/ && gitlens:hasRemotes",
"group": "inline@99",
"alt": "gitlens.copyRemoteFileUrlToClipboard"
},
{
"command": "gitlens.openFileInRemote",
"when": "viewItem =~ /gitlens:file\\b/ && gitlens:hasRemotes",
"group": "4_gitlens@1"
},
{
"command": "gitlens.copyRemoteFileUrlToClipboard",
"when": "viewItem =~ /gitlens:file\\b/ && gitlens:hasRemotes",
"when": "viewItem =~ /gitlens:(file|history:(file|line)|status:file)\\b/ && gitlens:hasRemotes",
"group": "5_gitlens@3"
},
{
@ -3441,15 +3490,10 @@
},
{
"command": "gitlens.openFileInRemote",
"when": "viewItem =~ /gitlens:(history-file|status:file)\\b/ && gitlens:hasRemotes",
"when": "viewItem =~ /gitlens:(history:(file|line)|status:file)\\b/ && gitlens:hasRemotes",
"group": "3_gitlens@2"
},
{
"command": "gitlens.copyRemoteFileUrlToClipboard",
"when": "viewItem =~ /gitlens:(history-file|status:file)\\b/ && gitlens:hasRemotes",
"group": "5_gitlens@3"
},
{
"command": "gitlens.views.applyChanges",
"when": "viewItem =~ /gitlens:file:(commit|results)\\b/",
"group": "5_gitlens_1@1"
@ -3480,13 +3524,18 @@
"group": "8_gitlens@2"
},
{
"command": "gitlens.openBranchesInRemote",
"command": "gitlens.openRepoInRemote",
"when": "viewItem == gitlens:remote",
"group": "1_gitlens@1"
"group": "inline@98"
},
{
"command": "gitlens.openRepoInRemote",
"when": "viewItem == gitlens:remote",
"group": "1_gitlens@1"
},
{
"command": "gitlens.openBranchesInRemote",
"when": "viewItem == gitlens:remote",
"group": "1_gitlens@2"
},
{

+ 1
- 1
src/views/nodes/lineHistoryNode.ts Bestand weergeven

@ -111,7 +111,7 @@ export class LineHistoryNode extends SubscribeableViewNode {
})}`,
TreeItemCollapsibleState.Expanded
);
item.contextValue = ResourceType.FileHistory;
item.contextValue = ResourceType.LineHistory;
item.tooltip = `History of ${this.uri.getFilename()}${lines}\n${this.uri.getDirectory()}/`;
item.iconPath = {

+ 4
- 3
src/views/nodes/viewNode.ts Bestand weergeven

@ -5,8 +5,8 @@ import { debug, gate, logName } from '../../system';
import { RefreshReason, TreeViewNodeStateChangeEvent, View } from '../viewBase';
export enum ResourceType {
ActiveFileHistory = 'gitlens:active:history-file',
ActiveLineHistory = 'gitlens:active:history-line',
ActiveFileHistory = 'gitlens:history:active:file',
ActiveLineHistory = 'gitlens:history:active:line',
Branch = 'gitlens:branch',
BranchWithTracking = 'gitlens:branch:tracking',
Branches = 'gitlens:branches',
@ -19,11 +19,12 @@ export enum ResourceType {
CommitFile = 'gitlens:file:commit',
Commits = 'gitlens:commits',
ComparisonResults = 'gitlens:results:comparison',
FileHistory = 'gitlens:history-file',
FileHistory = 'gitlens:history:file',
FileStaged = 'gitlens:file:staged',
FileStagedAndUnstaged = 'gitlens:file:staged:unstaged',
FileUnstaged = 'gitlens:file:unstaged',
Folder = 'gitlens:folder',
LineHistory = 'gitlens:history:line',
Message = 'gitlens:message',
Pager = 'gitlens:pager',
Remote = 'gitlens:remote',

Laden…
Annuleren
Opslaan