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

Option to find conflicting (duplicate) keyboard shortcuts #33745

Closed
brezanac opened this issue Sep 3, 2017 · 17 comments
Closed

Option to find conflicting (duplicate) keyboard shortcuts #33745

brezanac opened this issue Sep 3, 2017 · 17 comments
Assignees
Labels
feature-request Request for new features or functionality info-needed Issue requires more information from poster

Comments

@brezanac
Copy link

brezanac commented Sep 3, 2017

Many VSCode extensions come with their own set of keyboard shortcuts which usually do not conflict with those shipped as default with VSCode.

However, with multiple extensions installed it often happens that two or more of them register the same keyboard shortcut and since there is currently no system in place to prevent that (at least not to my knowledge) the only way to find out that there is a conflict is by actually using a shortcut and realizing it doesn't do what it's supposed to do.

I think that this feature is essential for a tool that relies so heavily on using shortcuts.

EDIT: Just to be clear, I am aware of the "Show conflicts" option in the right-click context menu but it basically just does a search for a specific keyboard shortcut (the one that has been right-clicked on).

What I am talking about is a feature that would, for example, color all duplicate entries in Keyboard shortcuts dialog red or at least warn if an extension is trying to register a shortcut that has already been declared.

@sandy081 sandy081 added feature-request Request for new features or functionality keybindings VS Code keybinding issues labels Sep 4, 2017
@sandy081 sandy081 added this to the Backlog milestone Sep 4, 2017
@sandy081 sandy081 added keybindings-editor Keybinding editor issues and removed keybindings VS Code keybinding issues labels Nov 27, 2017
@ezra100
Copy link

ezra100 commented May 6, 2018

Yeah, same goes for when the user tries to add/modify a shortcut, you usually expect a program to warn you if you override another shortcut, and you won't notice you override till you'll see it doesn't work.
Plus, even when you're aware of that, it's much easier to find an available shortcut when it warns you rather than using the search box.

@sandy081
Copy link
Member

sandy081 commented May 7, 2018

@ezra100 your scenario is different from what is reported here. Your scenario is when user is adding while the one here is when the extension is registering.

There is some work in progress (#40405) for your scenario

@brezanac
Copy link
Author

brezanac commented May 8, 2018

@sandy081 I was actually targeting any case where an already existing binding is registered multiple times, regardless of how the new binding is added.

If a user tries to add an already existing key-bind there should be a mechanism to prevent that. If a new extension tries to do the same there should also be a system to prevent that too.

@DRSDavidSoft
Copy link

I wonder if this is going to be implemented -- this seems to be an essential feature when having multiple extensions installed.

@sandy081
Copy link
Member

We provide following ways to find a similar keybinding

  • As mentioned in the description, there is a context menu action on keybinding entry to find similar keybindings
  • While you are assigning a keybinding, a link with similar keybindings is shown and clicking on them will shown similar keybindings.

Hope this is already helpful for what is asked here. I would close this unless you need more.

@sandy081 sandy081 removed this from the Backlog milestone Mar 25, 2019
@sandy081 sandy081 added info-needed Issue requires more information from poster and removed keybindings-editor Keybinding editor issues labels Mar 25, 2019
@brezanac
Copy link
Author

@sandy081 Is there currently a mechanism that also prevents newly installed extensions from registering already registered keybinds?

@DRSDavidSoft
Copy link

@sandy081 That is indeed helpful, but might I suggest adding two more functionalities:

  • sorting keybindings table by bindings
  • displaying all conflicting bindings that are already set from different extensions and/or previous user configuration

@sandy081
Copy link
Member

Is there currently a mechanism that also prevents newly installed extensions from registering already registered keybindings?

No

sorting keybindings table by bindings

There is an action in the Search input that sorts by precedence.

displaying all conflicting bindings that are already set from different extensions and/or previous user configuration

What is the purpose of it?

@DRSDavidSoft
Copy link

@sandy081 I might be mistaken but I believe multiple extensions can register the same keybinding for different actions

@sandy081
Copy link
Member

@DRSDavidSoft Yes thats possible. So you want to have an action that displays all commands with similar keybindings? If so, would like to know how the results will be used?

@DRSDavidSoft
Copy link

@sandy081 Yes, and it should be displayed right in the keybindings table. Maybe when searching for @duplicatestag?

Additionally, IMO the user should get a warning in the keybindings table if duplicates are indeed registered in VS Code.

@DRSDavidSoft
Copy link

DRSDavidSoft commented Mar 26, 2019

@sandy081 Here's a mockup I made:

Show a message

"Warning: ## duplicated keybindings found. Show duplicates..."

vs-code-dupes1

Search

Using @duplicated tag:

NOTE: Clicking on "Show duplicated..." would type the @duplicated tag in the search box

vs-code-dupes2

@sandy081
Copy link
Member

You can have a query for that but don't like showing it by default as I am sure this will be true always. If interested, please feel free to submit a PR implementing the query.

@DRSDavidSoft
Copy link

DRSDavidSoft commented Mar 27, 2019

@sandy081 I'll be happy to, if my typescript skills qualifies. What files in here do I need to edit?

@sandy081
Copy link
Member

@vscodebot vscodebot bot closed this as completed Apr 8, 2019
@vscodebot
Copy link

vscodebot bot commented Apr 8, 2019

This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.

Happy Coding!

@KaungZawHtet
Copy link

KaungZawHtet commented May 5, 2019

that @ duplicated tag is what i need now. How can i get in mine ? I can't do it in my vs code (version 1.33)

@vscodebot vscodebot bot locked and limited conversation to collaborators May 23, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality info-needed Issue requires more information from poster
Projects
None yet
Development

No branches or pull requests

5 participants