Skip to content

Rework Talon side to use destinations #1440

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

Closed
6 tasks done
Tracked by #1616 ...
pokey opened this issue Apr 25, 2023 · 0 comments
Closed
6 tasks done
Tracked by #1616 ...

Rework Talon side to use destinations #1440

pokey opened this issue Apr 25, 2023 · 0 comments
Labels
documentation Improvements or additions to documentation
Milestone

Comments

@pokey
Copy link
Member

pokey commented Apr 25, 2023

  • Update Talon side
  • Add deprecation warning if user says "to after"? I believe we support this today, and some users are still saying that, as indicated by slack questions from the past month. We could probably have this as an alternate spoken form for "after" and show a warning if they use it
  • Add destination box to the cheatsheet with "before target", "to target" and "after target"
  • Update "paste", "bring", "move" and others in cheatsheet to accept a destination and link to that box
  • Add destination to public api, and use it for snippets
  • Fix 'paste' documentation #1319

Talon side

On the Talon side, we would like to do the following:

1. Make "before", "after" and "to" into "insertion modes"

We'll have a new list called cursorless_insertion_mode, which will consist of "before", "after" and "to".

These terms should also be removed from both cursorless_position and cursorless_source_destination_connective.

Note that "end of" and "start of" remain as position modifiers.

2. Add new capture for destinations

Replace the <cursorless_positional_target> capture with the following:

@mod.capture(
    rule=(
        "{user.cursorless_insertion_mode} <user.cursorless_target> "
        "({user.cursorless_list_connective} {user.cursorless_insertion_mode} <user.cursorless_target>)*"
    )
)
def cursorless_destination(m) -> list[dict]:
    return {
        "type": "destinationList",
        "destinations": [
            {
                "type": "destination",
                "insertionMode": insertion_mode,
                "target": target,
            }
            for insertion_mode, target in zip(m.cursorless_insertion_mode, m.cursorless_target)
        ]
    }

Note that we are using the cursorless_target capture as part of this capture, which can contain its own "and"s. That's how we support "after air and bat and before cap".

We would then use this new cursorless_destination capture wherever we use cursorless_positional_target today.

Note that we might instead want to do something like we do with targets, where the primitive destination can appear at the top level when there is no "and"

Problems

  • We already have "before" and "after" in positions.csv, and "to" in connectives.csv, but ideally we'd move them into the same file as each other
@pokey pokey added this to the Short list milestone Apr 25, 2023
@auscompgeek auscompgeek added the documentation Improvements or additions to documentation label May 7, 2023
@pokey pokey changed the title Rework user-facing api / docs to use destinations Rework Talon side to use destinations Jul 11, 2023
@AndreasArvidsson AndreasArvidsson linked a pull request Jul 30, 2023 that will close this issue
11 tasks
@pokey pokey removed a link to a pull request Jul 31, 2023
11 tasks
@AndreasArvidsson AndreasArvidsson linked a pull request Aug 1, 2023 that will close this issue
11 tasks
@AndreasArvidsson AndreasArvidsson removed a link to a pull request Aug 1, 2023
11 tasks
github-merge-queue bot pushed a commit that referenced this issue Aug 6, 2023
Depends on #1637

- Fixes #725
- Partially addresses #1440
- Fixes #1319 

## Checklist

- [/] I have added
[tests](https://www.cursorless.org/docs/contributing/test-case-recorder/)
- [x] 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)
- [x] Update cheatsheet spoken form defaults
- [x] Manually test the various snippet terms
- [x] Manually test the snippet apis
- [ ] I have not broken the cheatsheet

---------

Co-authored-by: Pokey Rule <[email protected]>
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
cursorless-bot pushed a commit that referenced this issue Aug 6, 2023
Depends on #1637

- Fixes #725
- Partially addresses #1440
- Fixes #1319 

## Checklist

- [/] I have added
[tests](https://www.cursorless.org/docs/contributing/test-case-recorder/)
- [x] 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)
- [x] Update cheatsheet spoken form defaults
- [x] Manually test the various snippet terms
- [x] Manually test the snippet apis
- [ ] I have not broken the cheatsheet

---------

Co-authored-by: Pokey Rule <[email protected]>
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
@AndreasArvidsson AndreasArvidsson removed their assignment Aug 7, 2023
@pokey pokey closed this as completed Feb 8, 2024
thetomcraig-aya pushed a commit to thetomcraig/cursorless that referenced this issue Mar 27, 2024
Depends on cursorless-dev#1637

- Fixes cursorless-dev#725
- Partially addresses cursorless-dev#1440
- Fixes cursorless-dev#1319 

## Checklist

- [/] I have added
[tests](https://www.cursorless.org/docs/contributing/test-case-recorder/)
- [x] 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)
- [x] Update cheatsheet spoken form defaults
- [x] Manually test the various snippet terms
- [x] Manually test the snippet apis
- [ ] I have not broken the cheatsheet

---------

Co-authored-by: Pokey Rule <[email protected]>
Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants