Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show command shortcuts in toolbar item tooltips. #12660

Merged
merged 2 commits into from
Jul 6, 2023

Conversation

tsmaeder
Copy link
Contributor

What it does

Shows the active shortcuts for commands in view toolbars, etc. and on rows in contributed tree views. The linked issue has more discussion about the limitations of the implementation here: #12656 (comment)

Fixes #12656

Contributed on behalf of STMicroelectronics

How to test

The attached plugin contributes a view "Test View Drag and Drop" with a "Print Selection" command in both the view toolbar and on each tree item. There is also a "Toggle enablement" command that toggles the enablePrintSelection context key on and off. While toggling enablement on and off, make sure the correct shortcut is shown 1. in the view toolbar 2. in the global toolbar (you'll have to add the "Print Selection" command manually) and on the individual tree items in the view. You can play with the keybindings in the keymaps.json file (open via the keybindings preference page). For example like so:

{
    "command": "treeViewDnD.printSelection",
    "keybinding": "ctrl+h",
    "when": "!enablePrintSelection"
},
{
    "command": "-treeViewDnD.printSelection",
    "keybinding": "ctrl+o",
    "when": "enablePrintSelection"
}

Review checklist

Reminder for reviewers

@msujew
Copy link
Member

msujew commented Jul 5, 2023

@tsmaeder Where is the attached plugin? I haven't found it under any link in this PR or the linked issue.

@tsmaeder
Copy link
Contributor Author

tsmaeder commented Jul 5, 2023

@msujew 🤦

@tsmaeder
Copy link
Contributor Author

tsmaeder commented Jul 5, 2023

Here's the *.vsix:

custom-view-samples-0.0.1.zip

and the source:_

tree-view-sample.zip

Copy link
Member

@msujew msujew left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me 👍

  • Keybindings are shown in the tabbar toolbars
  • Keybindings are shown in tree view command items
  • All items are updated as expected when context keys or keybindings change

…12656

Contributed on behalf of STMicroelectronics

Signed-off-by: Thomas Mäder <t.s.maeder@gmail.com>
Signed-off-by: Thomas Mäder <t.s.maeder@gmail.com>
@tsmaeder tsmaeder merged commit 17720a4 into eclipse-theia:master Jul 6, 2023
@vince-fugnitto vince-fugnitto added this to the 1.40.0 milestone Jul 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Show Keyboard Shortcuts in Toolbar Item Tooltips
3 participants