Skip to content

Commit 75ddac6

Browse files
Far0nchdsbd
andauthored
Submenu option for Githubinator commands (#58)
- Replaces the boolean setting `enable_context_menu` with dropdown `contextMenu` with three options: - `enabled`: same as `enable_context_menu = true` - `submenu`: puts all commands into a submenu "Githubinator" - `disabled`: same as `enable_context_menu = false` - Adds a toggle for each command to specify whether it is shown in the context menu ![grafik](https://user-images.githubusercontent.com/6949295/205152328-20377c78-94f0-45de-b375-3f8f1e1b0be5.png) - Related issue: #57 Co-authored-by: Christopher Dignam <[email protected]>
1 parent 4daea87 commit 75ddac6

File tree

3 files changed

+202
-17
lines changed

3 files changed

+202
-17
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
## 2.1.0 - 2022-12-10
11+
12+
### Changed
13+
14+
- Replaced `enable_context_menu` with new option to allow configuring Githubinator to display context menu options in a submenu. Thanks @Far0n! (#58)
15+
1016
## 2.0.1 - 2022-05-26
1117

1218
### Fixed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ The "main" branch is configured via `githubinator.mainBranches` (see "Extension
5151

5252
## Extension Settings
5353

54-
- `githubinator.enable_context_menu`: Enable access to Githubinator commands from the context menu. (default: `true`)
54+
- `githubinator.contextMenu`: Enable access to Githubinator commands from the context menu (`"enabled"`|`"submenu"`|`"disabled"`). (default: `"enabled"`)
5555
- `githubinator.mainBranches`: Branch names to use as `main` repository branch. (default: `["main", "master", "trunk", "develop", "dev"]`)
5656
- `githubinator.remote`: The default remote branch for a repository. (default: `"origin"`)
5757
- `githubinator.providers.github.remote`: Remote name to look for when identifying a Github origin. (default: `"origin"`)

package.json

Lines changed: 195 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "githubinator",
33
"displayName": "Githubinator",
44
"description": "Quickly open files on Github and other providers. View blame information, copy permalinks and more. See the \"commands\" section of the README for more details.",
5-
"version": "2.0.1",
5+
"version": "2.1.0",
66
"publisher": "chdsbd",
77
"license": "SEE LICENSE IN LICENSE",
88
"icon": "images/logo256.png",
@@ -124,84 +124,263 @@
124124
{
125125
"command": "extension.githubinator",
126126
"group": "githubinator@1",
127-
"when": "config.githubinator.enable_context_menu"
127+
"when": "config.githubinator.contextMenu == enabled && config.githubinator.contextMenuGithubinator"
128128
},
129129
{
130130
"command": "extension.githubinatorCopy",
131131
"group": "githubinator@2",
132-
"when": "config.githubinator.enable_context_menu"
132+
"when": "config.githubinator.contextMenu == enabled && config.githubinator.contextMenuCopy"
133133
},
134134
{
135135
"command": "extension.githubinatorCopyMaster",
136136
"group": "githubinator@3",
137-
"when": "config.githubinator.enable_context_menu"
137+
"when": "config.githubinator.contextMenu == enabled && config.githubinator.contextMenuCopyMaster"
138138
},
139139
{
140140
"command": "extension.githubinatorCopyPermalink",
141141
"group": "githubinator@4",
142-
"when": "config.githubinator.enable_context_menu"
142+
"when": "config.githubinator.contextMenu == enabled && config.githubinator.contextMenuCopyPermalink"
143143
},
144144
{
145145
"command": "extension.githubinatorCopyMasterPermalink",
146146
"group": "githubinator@5",
147-
"when": "config.githubinator.enable_context_menu"
147+
"when": "config.githubinator.contextMenu == enabled && config.githubinator.contextMenuCopyMasterPermalink"
148148
},
149149
{
150150
"command": "extension.githubinatorOnMaster",
151151
"group": "githubinator@6",
152-
"when": "config.githubinator.enable_context_menu"
152+
"when": "config.githubinator.contextMenu == enabled && config.githubinator.contextMenuOnMaster"
153153
},
154154
{
155155
"command": "extension.githubinatorPermalink",
156156
"group": "githubinator@7",
157-
"when": "config.githubinator.enable_context_menu"
157+
"when": "config.githubinator.contextMenu == enabled && config.githubinator.contextMenuPermalink"
158158
},
159159
{
160160
"command": "extension.githubinatorBlame",
161161
"group": "githubinator@8",
162-
"when": "config.githubinator.enable_context_menu"
162+
"when": "config.githubinator.contextMenu == enabled && config.githubinator.contextMenuBlame"
163163
},
164164
{
165165
"command": "extension.githubinatorBlameOnMaster",
166166
"group": "githubinator@9",
167-
"when": "config.githubinator.enable_context_menu"
167+
"when": "config.githubinator.contextMenu == enabled && config.githubinator.contextMenuBlameOnMaster"
168168
},
169169
{
170170
"command": "extension.githubinatorBlamePermalink",
171171
"group": "githubinator@10",
172-
"when": "config.githubinator.enable_context_menu"
172+
"when": "config.githubinator.contextMenu == enabled && config.githubinator.contextMenuBlamePermalink"
173173
},
174174
{
175175
"command": "extension.githubinatorRepository",
176176
"group": "githubinator@11",
177-
"when": "config.githubinator.enable_context_menu"
177+
"when": "config.githubinator.contextMenu == enabled && config.githubinator.contextMenuRepository"
178178
},
179179
{
180180
"command": "extension.githubinatorHistory",
181181
"group": "githubinator@12",
182-
"when": "config.githubinator.enable_context_menu"
182+
"when": "config.githubinator.contextMenu == enabled && config.githubinator.contextMenuHistory"
183183
},
184184
{
185185
"command": "extension.githubinatorOpenPR",
186186
"group": "githubinator@13",
187-
"when": "config.githubinator.enable_context_menu"
187+
"when": "config.githubinator.contextMenu == enabled && config.githubinator.contextMenuOpenPR"
188188
},
189189
{
190190
"command": "extension.githubinatorCompare",
191191
"group": "githubinator@14",
192-
"when": "config.githubinator.enable_context_menu"
192+
"when": "config.githubinator.contextMenu == enabled && config.githubinator.contextMenuCompare"
193+
},
194+
{
195+
"submenu": "extension.githubinatorSubmenu",
196+
"group": "githubinator@15"
197+
}
198+
],
199+
"extension.githubinatorSubmenu": [
200+
{
201+
"command": "extension.githubinator",
202+
"group": "githubinator@1",
203+
"when": "config.githubinator.contextMenu == submenu && config.githubinator.contextMenuGithubinator"
204+
},
205+
{
206+
"command": "extension.githubinatorCopy",
207+
"group": "githubinator@2",
208+
"when": "config.githubinator.contextMenu == submenu && config.githubinator.contextMenuCopy"
209+
},
210+
{
211+
"command": "extension.githubinatorCopyMaster",
212+
"group": "githubinator@3",
213+
"when": "config.githubinator.contextMenu == submenu && config.githubinator.contextMenuCopyMaster"
214+
},
215+
{
216+
"command": "extension.githubinatorCopyPermalink",
217+
"group": "githubinator@4",
218+
"when": "config.githubinator.contextMenu == submenu && config.githubinator.contextMenuCopyPermalink"
219+
},
220+
{
221+
"command": "extension.githubinatorCopyMasterPermalink",
222+
"group": "githubinator@5",
223+
"when": "config.githubinator.contextMenu == submenu && config.githubinator.contextMenuCopyMasterPermalink"
224+
},
225+
{
226+
"command": "extension.githubinatorOnMaster",
227+
"group": "githubinator@6",
228+
"when": "config.githubinator.contextMenu == submenu && config.githubinator.contextMenuOnMaster"
229+
},
230+
{
231+
"command": "extension.githubinatorPermalink",
232+
"group": "githubinator@7",
233+
"when": "config.githubinator.contextMenu == submenu && config.githubinator.contextMenuPermalink"
234+
},
235+
{
236+
"command": "extension.githubinatorBlame",
237+
"group": "githubinator@8",
238+
"when": "config.githubinator.contextMenu == submenu && config.githubinator.contextMenuBlame"
239+
},
240+
{
241+
"command": "extension.githubinatorBlameOnMaster",
242+
"group": "githubinator@9",
243+
"when": "config.githubinator.contextMenu == submenu && config.githubinator.contextMenuBlameOnMaster"
244+
},
245+
{
246+
"command": "extension.githubinatorBlamePermalink",
247+
"group": "githubinator@10",
248+
"when": "config.githubinator.contextMenu == submenu && config.githubinator.contextMenuBlamePermalink"
249+
},
250+
{
251+
"command": "extension.githubinatorRepository",
252+
"group": "githubinator@11",
253+
"when": "config.githubinator.contextMenu == submenu && config.githubinator.contextMenuRepository"
254+
},
255+
{
256+
"command": "extension.githubinatorHistory",
257+
"group": "githubinator@12",
258+
"when": "config.githubinator.contextMenu == submenu && config.githubinator.contextMenuHistory"
259+
},
260+
{
261+
"command": "extension.githubinatorOpenPR",
262+
"group": "githubinator@13",
263+
"when": "config.githubinator.contextMenu == submenu && config.githubinator.contextMenuOpenPR"
264+
},
265+
{
266+
"command": "extension.githubinatorCompare",
267+
"group": "githubinator@14",
268+
"when": "config.githubinator.contextMenu == submenu && config.githubinator.contextMenuCompare"
193269
}
194270
]
195271
},
272+
"submenus": [
273+
{
274+
"label": "Githubinator",
275+
"id": "extension.githubinatorSubmenu"
276+
}
277+
],
196278
"configuration": {
197279
"type": "object",
198280
"title": "Githubinator",
199281
"properties": {
200282
"githubinator.enable_context_menu": {
201283
"type": "boolean",
202-
"default": true,
284+
"default": false,
285+
"markdownDeprecationMessage": "**Deprecated**: Please use `#githubinator.contextMenu#` instead.",
286+
"deprecationMessage": "Deprecated: Please use githubinator.contextMenu instead.",
287+
"description": "Enable access to Githubinator commands from the context menu."
288+
},
289+
"githubinator.contextMenu": {
290+
"type": "string",
291+
"enum": [
292+
"enabled",
293+
"submenu",
294+
"disabled"
295+
],
296+
"default": "enabled",
297+
"order": 0,
203298
"description": "Enable access to Githubinator commands from the context menu."
204299
},
300+
"githubinator.contextMenuGithubinator": {
301+
"type": "boolean",
302+
"default": "true",
303+
"order": 1,
304+
"markdownDescription": "Access command **Githubinator** via context menu."
305+
},
306+
"githubinator.contextMenuCopy": {
307+
"type": "boolean",
308+
"default": "true",
309+
"order": 2,
310+
"markdownDescription": "Access command **Copy** via context menu."
311+
},
312+
"githubinator.contextMenuCopyMaster": {
313+
"type": "boolean",
314+
"default": "true",
315+
"order": 3,
316+
"markdownDescription": "Access command **Copy Main** via context menu."
317+
},
318+
"githubinator.contextMenuCopyPermalink": {
319+
"type": "boolean",
320+
"default": "true",
321+
"order": 4,
322+
"markdownDescription": "Access command **Copy Permalink** via context menu."
323+
},
324+
"githubinator.contextMenuCopyMasterPermalink": {
325+
"type": "boolean",
326+
"default": "true",
327+
"order": 5,
328+
"markdownDescription": "Access command **Copy Main Permalink** via context menu."
329+
},
330+
"githubinator.contextMenuOnMaster": {
331+
"type": "boolean",
332+
"default": "true",
333+
"order": 6,
334+
"markdownDescription": "Access command **On Main** via context menu."
335+
},
336+
"githubinator.contextMenuPermalink": {
337+
"type": "boolean",
338+
"default": "true",
339+
"order": 7,
340+
"markdownDescription": "Access command **Permalink** via context menu."
341+
},
342+
"githubinator.contextMenuBlame": {
343+
"type": "boolean",
344+
"default": "true",
345+
"order": 8,
346+
"markdownDescription": "Access command **Blame** via context menu."
347+
},
348+
"githubinator.contextMenuBlameOnMaster": {
349+
"type": "boolean",
350+
"default": "true",
351+
"order": 9,
352+
"markdownDescription": "Access command **Blame On Main** via context menu."
353+
},
354+
"githubinator.contextMenuBlamePermalink": {
355+
"type": "boolean",
356+
"default": "true",
357+
"order": 10,
358+
"markdownDescription": "Access command **Blame Permalink** via context menu."
359+
},
360+
"githubinator.contextMenuRepository": {
361+
"type": "boolean",
362+
"default": "true",
363+
"order": 11,
364+
"markdownDescription": "Access command **Repository** via context menu."
365+
},
366+
"githubinator.contextMenuHistory": {
367+
"type": "boolean",
368+
"default": "true",
369+
"order": 12,
370+
"markdownDescription": "Access command **History** via context menu."
371+
},
372+
"githubinator.contextMenuOpenPR": {
373+
"type": "boolean",
374+
"default": "true",
375+
"order": 13,
376+
"markdownDescription": "Access command **OpenPR** via context menu."
377+
},
378+
"githubinator.contextMenuCompare": {
379+
"type": "boolean",
380+
"default": "true",
381+
"order": 14,
382+
"markdownDescription": "Access command **Compare** via context menu."
383+
},
205384
"githubinator.mainBranches": {
206385
"type": "array",
207386
"items": {

0 commit comments

Comments
 (0)