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

Basic keyboard features #2169

Merged
merged 8 commits into from
Jan 16, 2024
Merged

Basic keyboard features #2169

merged 8 commits into from
Jan 16, 2024

Conversation

pokey
Copy link
Member

@pokey pokey commented Jan 10, 2024

Checklist

  • I have added tests
  • [-] I have updated the docs and cheatsheet
  • [-] I have not broken the cheatsheet

@pokey pokey force-pushed the pokey/basic-keyboard-features branch from ce3c1ca to 6d92345 Compare January 10, 2024 16:45
@pokey pokey force-pushed the pokey/add-keyboard-special-target branch 2 times, most recently from 2becfef to a82b28d Compare January 11, 2024 16:41
@pokey pokey force-pushed the pokey/basic-keyboard-features branch 2 times, most recently from 18e3e3f to 73cc06b Compare January 11, 2024 17:07
@pokey pokey force-pushed the pokey/add-keyboard-special-target branch 2 times, most recently from 17643e6 to bdab379 Compare January 11, 2024 17:28
@pokey pokey force-pushed the pokey/basic-keyboard-features branch from 73cc06b to 8fad1fe Compare January 11, 2024 17:28
@pokey pokey force-pushed the pokey/add-keyboard-special-target branch from bdab379 to e31466b Compare January 15, 2024 13:47
@pokey pokey force-pushed the pokey/basic-keyboard-features branch from 8fad1fe to 9fc74ca Compare January 15, 2024 13:47
Base automatically changed from pokey/add-keyboard-special-target to main January 15, 2024 14:13
@pokey pokey force-pushed the pokey/basic-keyboard-features branch 2 times, most recently from 8c675e3 to 35b1dd7 Compare January 15, 2024 16:04
@pokey pokey mentioned this pull request Jan 15, 2024
3 tasks
@pokey pokey force-pushed the pokey/basic-keyboard-features branch from 35b1dd7 to a9429d1 Compare January 15, 2024 16:08
@pokey pokey force-pushed the pokey/basic-keyboard-features branch from f13d1c6 to 8e65c5e Compare January 15, 2024 16:16
@pokey pokey marked this pull request as ready for review January 15, 2024 16:23
@pokey
Copy link
Member Author

pokey commented Jan 15, 2024

ok @josharian I'm happy; have a look at my changes and make sure you are too 😊. The first commit should be a fairly unmolested version of your PR, so might be helpful to focus on the diff of the remaining commits

@pokey
Copy link
Member Author

pokey commented Jan 15, 2024

@AndreasArvidsson when you get a minute, feel free to hide everything in keyboard dir and approve if you're happy with the remainder. I'll wait for @josharian's approval on the rest before merging

Copy link
Collaborator

@josharian josharian left a comment

Choose a reason for hiding this comment

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

LGTM modulo little nits

@@ -108,6 +108,8 @@ export default class KeyboardCommandsModal {

modeOn = async () => {
if (this.isModeOn()) {
// Set target to current selection if we re-run mode on
Copy link
Collaborator

Choose a reason for hiding this comment

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

don't follow this comment (can't even quite parse it)

Copy link
Member Author

Choose a reason for hiding this comment

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

While trying to write a better comment, I decided I didn't like the way it was implemented. See https://github.com/cursorless-dev/cursorless/pull/2169/files#diff-9c79f806edb4ea294501b9810d847bd61a9cb17bcfe6930f91ca4cf062a36fc5 for my new solution

@pokey
Copy link
Member Author

pokey commented Jan 16, 2024

ok @josharian all good?

@josharian
Copy link
Collaborator

LGTM but s/alread/already/

I assume there’s no VSCode event for when the cursor moves? (Thinking about future automation of keeping the selection in sync.)

@pokey
Copy link
Member Author

pokey commented Jan 16, 2024

I assume there’s no VSCode event for when the cursor moves? (Thinking about future automation of keeping the selection in sync.)

There is, but I'm not sure that's desirable

@josharian
Copy link
Collaborator

Yeah, maybe not.

@pokey pokey enabled auto-merge January 16, 2024 16:00
@pokey pokey added this pull request to the merge queue Jan 16, 2024
Merged via the queue into main with commit 9ff8ea7 Jan 16, 2024
14 checks passed
@pokey pokey deleted the pokey/basic-keyboard-features branch January 16, 2024 16:18
github-merge-queue bot pushed a commit that referenced this pull request Jan 20, 2024
The original partial arg code constructed a partial arg where each field
of the top-level command arg was either completely filled out or
completely missing. Before #2169, that was fine, because the top-level
commands were more specific, and thus their args had more detail and the
command id itself told you more. For example, in
`modifyTargetContainingScopeType`, you had a specific scope type that
was missing, but you knew from command id that it was "containing".

As of #2169, we do a lot more in the lower level captures. For example
`modifyTargetContainingScopeType` and `modifyTargetEveryScopeType` are
now just `modifyTarget`, which only has a `modifier` key at the top
level, so you don't know until the very end what you're dealing with,
because every modifier just looks like `{command: "modifyTarget",
partialArg: {modifier: undefined}}`.

This PR deeply reconstructs the partial target, so that you can get much
more information. See the new test cases for examples of these partial
arguments

- Depends on #2169

## Checklist

- [x] Switch to `CURRENT` for default arg
- [x] Remove unique queue file
- [x] I have added
[tests](https://www.cursorless.org/docs/contributing/test-case-recorder/)
- [-] I have updated the
[docs](https://github.com/cursorless-dev/cursorless/tree/main/docs) and
[cheatsheet](https://github.com/cursorless-dev/cursorless/tree/main/cursorless-talon/src/cheatsheet)
- [-] I have not broken the cheatsheet
bjaspan pushed a commit to bjaspan/cursorless that referenced this pull request Jan 22, 2024
bjaspan pushed a commit to bjaspan/cursorless that referenced this pull request Jan 22, 2024
The original partial arg code constructed a partial arg where each field
of the top-level command arg was either completely filled out or
completely missing. Before cursorless-dev#2169, that was fine, because the top-level
commands were more specific, and thus their args had more detail and the
command id itself told you more. For example, in
`modifyTargetContainingScopeType`, you had a specific scope type that
was missing, but you knew from command id that it was "containing".

As of cursorless-dev#2169, we do a lot more in the lower level captures. For example
`modifyTargetContainingScopeType` and `modifyTargetEveryScopeType` are
now just `modifyTarget`, which only has a `modifier` key at the top
level, so you don't know until the very end what you're dealing with,
because every modifier just looks like `{command: "modifyTarget",
partialArg: {modifier: undefined}}`.

This PR deeply reconstructs the partial target, so that you can get much
more information. See the new test cases for examples of these partial
arguments

- Depends on cursorless-dev#2169

## Checklist

- [x] Switch to `CURRENT` for default arg
- [x] Remove unique queue file
- [x] I have added
[tests](https://www.cursorless.org/docs/contributing/test-case-recorder/)
- [-] I have updated the
[docs](https://github.com/cursorless-dev/cursorless/tree/main/docs) and
[cheatsheet](https://github.com/cursorless-dev/cursorless/tree/main/cursorless-talon/src/cheatsheet)
- [-] I have not broken the cheatsheet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants