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

Added glyph scope #2050

Merged
merged 22 commits into from
Dec 11, 2023
Merged

Added glyph scope #2050

merged 22 commits into from
Dec 11, 2023

Conversation

AndreasArvidsson
Copy link
Member

@AndreasArvidsson AndreasArvidsson commented Nov 20, 2023

chuck glyph dollar red air

Fixes #54

Checklist

Copy link
Member

@pokey pokey left a comment

Choose a reason for hiding this comment

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

I reviewed until I realised this was a modifier, and then stopped, because that's a pretty fatal flaw imo

cursorless-talon/src/modifiers/glyph.py Outdated Show resolved Hide resolved
cursorless-talon/src/modifiers/glyph.py Outdated Show resolved Hide resolved
@AndreasArvidsson AndreasArvidsson changed the title Added glyph modifier Added glyph scope Nov 23, 2023
Copy link
Member

@pokey pokey left a comment

Choose a reason for hiding this comment

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

Added spoken form generation in https://github.com/cursorless-dev/cursorless/pull/2050/files/f71f10bb58899de588c834b02effd5005a2d0987..a9473540a5e42be455a9d2d349b22b47b7ac1d59.

I still need to add tests for the custom spoken form generation. That will take a little effort, as we only have good infra for testing custom spoken forms for scopes yielded by our scope provider, which doesn't yield glyph scopes. I'll take a crack at that tomorrow. If it gets too painful I'll put it in a separate PR

@pokey
Copy link
Member

pokey commented Dec 8, 2023

Not sure glyph and literal are the same. Arguably glyph should go through same grapheme normalisation as hat chars, whereas literal wouldn't necessarily

@AndreasArvidsson
Copy link
Member Author

Then do you argue that I should revert this last commit back to only matching a single character? Because the implementation python side of this is the same capture that we use for decorated marks.

@pokey
Copy link
Member

pokey commented Dec 9, 2023

I'm just arguing maybe we keep the same naming convention you had before (glyph scope / character as field). I don't feel strongly, just a thought. Maybe let's discuss if you disagree / aren't sure?

@AndreasArvidsson
Copy link
Member Author

I'm happy with reverting

@AndreasArvidsson
Copy link
Member Author

Reverted to the old naming scheme

Copy link
Member

@pokey pokey left a comment

Choose a reason for hiding this comment

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

Ok I added a test for custom spoken form generation. I left one more comment. Once that's addressed, and if you're happy with my changes, let's ship it!

Copy link
Member

Choose a reason for hiding this comment

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

Cheatsheet seems to still have it as a modifier

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed

@@ -175,7 +168,7 @@ function updateEntriesForType<T extends SpokenFormType>(
defaultSpokenForms,
spokenForms: customSpokenForms,
requiresTalonUpdate: false,
isCustom: isEqual(defaultSpokenForms, customSpokenForms),
isCustom: !isEqual(defaultSpokenForms, customSpokenForms),
Copy link
Member

Choose a reason for hiding this comment

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

whoops 😅. we don't have any use case for this yet, but should prob add a test at some point

Copy link
Member Author

@AndreasArvidsson AndreasArvidsson Dec 11, 2023

Choose a reason for hiding this comment

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

Really proves that if something isn't tested it can easily be incorrect :)

Copy link
Member

@pokey pokey left a comment

Choose a reason for hiding this comment

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

Looks like defaults.json had rotted a bit. I fixed the updater and ran it. Also made some slight tweaks to the cheatsheet entry for glyph. If you're happy with my changes (bc474c9) let's ship it!

@AndreasArvidsson AndreasArvidsson added this pull request to the merge queue Dec 11, 2023
Merged via the queue into main with commit 8f88564 Dec 11, 2023
14 checks passed
@AndreasArvidsson AndreasArvidsson deleted the glyph_modifier branch December 11, 2023 19:17
cursorless-bot pushed a commit that referenced this pull request Dec 11, 2023
`chuck glyph dollar red air`

Fixes #54

## 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: Pokey Rule <[email protected]>
@pokey pokey mentioned this pull request Jan 19, 2024
3 tasks
thetomcraig-aya pushed a commit to thetomcraig/cursorless that referenced this pull request Mar 27, 2024
`chuck glyph dollar red air`

Fixes cursorless-dev#54

## 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: Pokey Rule <[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.

Support jump to sub character by letter name
3 participants