Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Modifying ChordKeybinding to support multiple chords #65826
Hi! I'm very interested in getting support for keychords of more than two keys (see #6966), so here's a PR to kick off my interest.
I think a see a general strategy to get there, but before I get too deep, I wanted to get a quick review on my approach.
In general, it looks like many parts of the code base are built on the concept of a "firstPart" and a "chordPart" for key chords. I think the first step is modifying all of these to support an arbitrary number of parts. Once that is done, the logic needs to be modified slightly to iteratively run through each part rather than stop at the first two.
As a start to support key chords of longer than two parts,
@alexandrudima you are the assignee of the ticket mentioned. Would you mind giving me some feedback on this approach?
It was difficult to refactor the ResolvedKeybindings without also refactoring label creators, as the null checks where handled in the label generation.
The major change with the unit tests was no longer requiring a secondary null field for dispatchparts. As chords can be any length, it's more forward-thinking to modify the unit tests to accept new behavior.
@alexandrudima I think I have everything for the first major change. I've made the choice to modify some interfaces slightly in a more future direction (return an array of parts vs a chord part). So you'll see a lot of changes there.
Also I'm switching all bindings to ChordKeybinding rather than SingleKeybinding because it removes the conditional code significantly. Curious about your thoughts.
@toumorokoshi, I agree this PR has grown large enough.
I've only found a couple of bugs where some
I've also tweaked a bit the label calls and having done so, I plan to further refactor those classes and raise some methods to their abstract parent class.
The first one is rather easy to tackle, the second one is a bit more work, as the