Browse Source

Reworks menu contributions a bit more

main
Eric Amodio 6 years ago
parent
commit
be32e6b2aa
3 changed files with 38 additions and 38 deletions
  1. +24
    -24
      package.json
  2. +10
    -10
      src/extension.ts
  3. +4
    -4
      src/ui/config.ts

+ 24
- 24
package.json View File

@ -598,12 +598,13 @@
}
]
},
"explorer": {
"editorGroup": {
"anyOf": [
{ "enum": [false] },
{
"type": "object",
"properties": {
"blame": { "type": "boolean" },
"compare": { "type": "boolean" },
"history": { "type": "boolean" },
"remote": { "type": "boolean" }
@ -611,7 +612,7 @@
}
]
},
"tab": {
"editorTab": {
"anyOf": [
{ "enum": [false] },
{
@ -624,13 +625,12 @@
}
]
},
"tabGroup": {
"explorer": {
"anyOf": [
{ "enum": [false] },
{
"type": "object",
"properties": {
"blame": { "type": "boolean" },
"compare": { "type": "boolean" },
"history": { "type": "boolean" },
"remote": { "type": "boolean" }
@ -650,21 +650,21 @@
"history": false,
"remote": true
},
"explorer": {
"editorGroup": {
"blame": true,
"compare": true,
"history": true,
"remote": true
"history": false,
"remote": false
},
"tab": {
"editorTab": {
"compare": false,
"history": false,
"remote": true
},
"tabGroup": {
"blame": true,
"explorer": {
"compare": true,
"history": false,
"remote": false
"history": true,
"remote": true
}
},
"description": "Specifies which commands will be added to which menus",
@ -2238,65 +2238,65 @@
},
{
"command": "gitlens.diffWithPrevious",
"when": "editorTextFocus && !isInDiffEditor && gitlens:activeIsTracked && config.gitlens.menus.tabGroup.compare",
"when": "editorTextFocus && !isInDiffEditor && gitlens:activeIsTracked && config.gitlens.menus.editorGroup.compare",
"group": "navigation@98"
},
{
"command": "gitlens.diffWithPreviousInDiff",
"when": "isInDiffEditor && gitlens:activeIsTracked && config.gitlens.menus.tabGroup.compare",
"when": "isInDiffEditor && gitlens:activeIsTracked && config.gitlens.menus.editorGroup.compare",
"group": "navigation@98"
},
{
"command": "gitlens.diffWithNext",
"when": "editorTextFocus && gitlens:activeIsTracked && gitlens:activeIsTracked && gitlens:activeIsRevision && config.gitlens.menus.tabGroup.compare",
"when": "editorTextFocus && gitlens:activeIsTracked && gitlens:activeIsTracked && gitlens:activeIsRevision && config.gitlens.menus.editorGroup.compare",
"group": "navigation@99"
},
{
"command": "gitlens.toggleFileBlame",
"alt": "gitlens.toggleFileRecentChanges",
"when": "gitlens:activeIsBlameable && !gitlens:annotationStatus && config.gitlens.menus.tabGroup.blame",
"when": "gitlens:activeIsBlameable && !gitlens:annotationStatus && config.gitlens.menus.editorGroup.blame",
"group": "navigation@100"
},
{
"command": "gitlens.computingFileAnnotations",
"when": "gitlens:activeIsBlameable && gitlens:annotationStatus == computing && config.gitlens.menus.tabGroup.blame",
"when": "gitlens:activeIsBlameable && gitlens:annotationStatus == computing && config.gitlens.menus.editorGroup.blame",
"group": "navigation@100"
},
{
"command": "gitlens.clearFileAnnotations",
"when": "gitlens:activeIsBlameable && gitlens:annotationStatus == computed && config.gitlens.menus.tabGroup.blame",
"when": "gitlens:activeIsBlameable && gitlens:annotationStatus == computed && config.gitlens.menus.editorGroup.blame",
"group": "navigation@100"
},
{
"command": "gitlens.openFileInRemote",
"when": "gitlens:enabled && gitlens:activeHasRemote && config.gitlens.menus.tabGroup.remote",
"when": "gitlens:enabled && gitlens:activeHasRemote && config.gitlens.menus.editorGroup.remote",
"group": "4_gitlens"
},
{
"command": "gitlens.showQuickFileHistory",
"when": "editorFocus && gitlens:activeIsTracked && config.gitlens.menus.tabGroup.history",
"when": "editorFocus && gitlens:activeIsTracked && config.gitlens.menus.editorGroup.history",
"group": "4_gitlens"
}
],
"editor/title/context": [
{
"command": "gitlens.openFileInRemote",
"when": "gitlens:enabled && gitlens:activeHasRemote && config.gitlens.menus.tab.remote",
"when": "gitlens:enabled && gitlens:activeHasRemote && config.gitlens.menus.editorTab.remote",
"group": "2_files@100"
},
{
"command": "gitlens.diffWithPrevious",
"when": "gitlens:enabled && config.gitlens.menus.tab.compare",
"when": "gitlens:enabled && config.gitlens.menus.editorTab.compare",
"group": "1_gitlens_1@1"
},
{
"command": "gitlens.diffWithWorking",
"when": "gitlens:enabled && config.gitlens.menus.tab.compare",
"when": "gitlens:enabled && config.gitlens.menus.editorTab.compare",
"group": "1_gitlens_1@2"
},
{
"command": "gitlens.showQuickFileHistory",
"when": "gitlens:enabled && config.gitlens.menus.tab.history",
"when": "gitlens:enabled && config.gitlens.menus.editorTab.history",
"group": "1_gitlens_2@1"
}
],

+ 10
- 10
src/extension.ts View File

@ -272,21 +272,21 @@ async function migrateSettings(context: ExtensionContext, previousVersion: strin
history: !!m.editorContext.history,
remote: !!m.editorContext.remote
},
explorer: {
compare: !!m.explorerContext.fileDiff,
history: !!m.explorerContext.history,
remote: !!m.explorerContext.remote
editorGroup: {
blame: !!m.editorTitle.blame,
compare: !!m.editorTitle.fileDiff,
history: !!m.editorTitle.history,
remote: !!m.editorTitle.remote
},
tab: {
editorTab: {
compare: !!m.editorTitleContext.fileDiff,
history: !!m.editorTitleContext.history,
remote: !!m.editorTitleContext.remote
},
tabGroup: {
blame: !!m.editorTitle.blame,
compare: !!m.editorTitle.fileDiff,
history: !!m.editorTitle.history,
remote: !!m.editorTitle.remote
explorer: {
compare: !!m.explorerContext.fileDiff,
history: !!m.explorerContext.history,
remote: !!m.explorerContext.remote
}
} as IMenuConfig;
}

+ 4
- 4
src/ui/config.ts View File

@ -207,19 +207,19 @@ export interface IMenuConfig {
history: boolean;
remote: boolean;
};
explorer: boolean | {
editorGroup: boolean | {
compare: boolean;
history: boolean;
remote: boolean;
};
tab: boolean | {
editorTab: boolean | {
compare: boolean;
history: boolean;
remote: boolean;
};
tabGroup: boolean | {
explorer: boolean | {
compare: boolean;
history: boolean;
remote: boolean;
};
}

Loading…
Cancel
Save