Skip to content

Pattern matching support #831

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
wants to merge 9 commits into from

Conversation

purpleP
Copy link
Contributor

@purpleP purpleP commented Jul 4, 2022

I’m working on pattern matching support as discussed here and planning to add it to rust, java, c, c++, python, javascript, typescript and haskell (languages I know).

So far I don’t think cursorless even recognised new scopes. @pokey Can you point what I’m missing here?

@pokey
Copy link
Member

pokey commented Jul 5, 2022

Have you symlinked / copied cursorless-talon subdir of this branch into your talon user directory, replacing the deployed version of cursorless?

If so, maybe try restarting talon and saying "cursorless help" to see if they're appearing in the cheatsheet?

@purpleP purpleP force-pushed the feature/pattern_matching branch from b268a18 to 3950011 Compare July 5, 2022 19:25
@purpleP
Copy link
Contributor Author

purpleP commented Jul 5, 2022

Have you symlinked / copied cursorless-talon subdir of this branch into your talon user directory, replacing the deployed version of cursorless?

If so, maybe try restarting talon and saying "cursorless help" to see if they're appearing in the cheatsheet?

Thanks, that helped! Tell me please what do I need to add so that chuck branch would remove the empty line also? Or we just delegate that to a formatter?

@purpleP
Copy link
Contributor Author

purpleP commented Jul 5, 2022

@pokey

What should we do with alternatives in patterns in Rust? Python also has them.

I would propose to use new or scope since it’s short and maybe can be reused in boolean expressions etc.

@purpleP purpleP force-pushed the feature/pattern_matching branch from 99d9110 to 0e562f4 Compare July 6, 2022 16:41
@purpleP purpleP force-pushed the feature/pattern_matching branch from 3370e89 to e533feb Compare July 14, 2022 18:34
@purpleP purpleP force-pushed the feature/pattern_matching branch from e533feb to 3a3fdc6 Compare July 28, 2022 09:52
@purpleP purpleP force-pushed the feature/pattern_matching branch from abbf158 to 55ebccb Compare July 28, 2022 16:48
@purpleP purpleP force-pushed the feature/pattern_matching branch from 55ebccb to 7e7fcc4 Compare July 30, 2022 19:55
@pokey pokey self-assigned this Oct 11, 2022
@pokey pokey closed this Nov 18, 2022
@pokey pokey reopened this Dec 15, 2022
@pokey pokey closed this Dec 15, 2022
AndreasArvidsson added a commit that referenced this pull request Dec 15, 2022
- Partially addresses
#1172
- Waiting to add Talon side until we're more confident in this scope
type
- Split from #831

## Checklist

- [x] Add Typescript
- [x] Add C
- [x] Add C#
- [x] 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] I have not broken the cheatsheet

Co-authored-by: Michael Doronin <[email protected]>

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Andreas Arvidsson <[email protected]>
pokey added a commit that referenced this pull request Dec 21, 2022
- Partially addresses
#1172
- Waiting to add Talon side until we're more confident in this scope
type
- Split from #831

## Checklist

- [x] Add Typescript
- [x] Add C
- [x] Add C#
- [x] 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] I have not broken the cheatsheet

Co-authored-by: Michael Doronin <[email protected]>

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Andreas Arvidsson <[email protected]>
pokey added a commit that referenced this pull request Dec 22, 2022
- Adds `condition` support for Python ternaries
- Adds `condition` support for Python list comprehensions
- Adds `condition` support for Python match statements
- Adds `condition` support for Rust match statements
- Note that `"chuck"` includes the `if` keyword for match statements and
list comprehensions
- Split from #831

## Checklist

- [x] 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] I have not broken the cheatsheet

Co-authored-by: Michael Doronin <[email protected]>

Co-authored-by: Andreas Arvidsson <[email protected]>
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.

2 participants