Vscode-bookmarks: [FEATURE] - Use new submenu support for editor commands

Created on 10 Nov 2020  路  5Comments  路  Source: alefragnani/vscode-bookmarks

image

enhancement

All 5 comments

Hi @eamodio ,

Thanks for reporting. I was thinking about embracing this new API, right after it was made public. I just wonder how extensions, and VS Code itself, would deal with it. Would it simply update the extension to use submenus, or should give the user the possibility to choose the appearance, via _settings_?

Personally, I have mixed feelings. I like direct access to _most used_ context menu items, but I don鈥檛 like looong context menus, neither multi-level (more than 2) in context menu.

Just out of curiosity, how are you dealing with GitLens, or VS Code itself. Are you simply moving it to submenus or providing settings ?

Thank you

I have updated GitLens (in the very soon to be released v11) to take advantage of submenus to considerably reduce the number of items shown -- and so far I've been really happy with the results (I've even used some menu options more than I have in the past). I haven't offered a choice in it (just whether the show the menu items/submenus themselves).

Yeah, its a trade off -- and I would definitely limit it to a single level of submenus (no submenus in submenus).

That's great!

Thank you for your feedback 馃憤

Hi @eamodio ,

I just started to work on this, but found an issue that maybe you faced while updating GitLens.

Today I have those entries in that Context Menu. These entries refers to the very _main_ commands of the extension (available in the Command Palette), which as you can see, have keybindings attached. These keybindings are defined by the extension, btw. If the user changes these keybinding, these entries in the Context Menu are updated, as well.

But, If I move these entries to a new Bookmarks submenu, it appears too polluted which the now duplicated Bookmarks: prefix:

image

To solve this, I should contribute new commands, without the Bookmarks: prefix, and use these new commands, instead of the original ones. But now, these new Context Menu items does not _show_ the keybindings (because in fact, they don't have). And I can't simply assign the same keybinding for this new commands, because if the user already customised the original commands, these new entries will be outdated, and new users will have to customize 2 times the _same_ command.

The keybinding itself keeps working, because the _original commands_ are still there, available in the Command Palette, but it feels something is missing, in the Context Menu. The user may think the commands lost/don't have a keybinding.

If I was able to define alternative title for commands, when attached in the Context Menu, I could simply remove the Bookmarks: prefix. Or, if I could make one command reuse the keybinding from another command, it could help too.

Am I missing something?

Thank you

Sorry for the long delay in getting back to you here.

Since these menu items are now in a submenu labeled _Bookmarks_, you don't need the _Bookmark:_ prefix, so you can just remove that prefix from the command title. And to keep the prefix in the command palette, add "category": "Bookmark", to each command -- that will "scope" them to that grouping in the command palette.

Hope that helps!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

it-sha picture it-sha  路  5Comments

jing2si picture jing2si  路  4Comments

ghost picture ghost  路  5Comments

pankajpatel picture pankajpatel  路  6Comments

ashmckenzie picture ashmckenzie  路  5Comments