-
-
Notifications
You must be signed in to change notification settings - Fork 85
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
Added glyph scope #2050
Changes from 6 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
cba14c8
Added glyph modifier
AndreasArvidsson 736a736
Update cheat cheat
AndreasArvidsson 96b0066
Converted to scope
AndreasArvidsson 1504e10
cleanup
AndreasArvidsson 7275816
Added unicode test
AndreasArvidsson e50f633
Organise imports
AndreasArvidsson 6e36c8c
Made glyph case insensitive
AndreasArvidsson 5cf0880
Merge branch 'main' into glyph_modifier
AndreasArvidsson dfddc0b
Merge branch 'main' into glyph_modifier
pokey f71f10b
fixup
pokey 3d5dfc5
Add spoken form generation for "glyph"
pokey a947354
Tweaks
pokey ac00a54
fix
pokey d426a66
Merge branch 'main' into glyph_modifier
AndreasArvidsson 4ed60fb
Renamed glyph_scope to literal_scope
AndreasArvidsson c920f17
Merge branch 'main' into glyph_modifier
AndreasArvidsson 8d1416f
Merge branch 'main' into glyph_modifier
AndreasArvidsson 31f4d3d
Revert "Renamed glyph_scope to literal_scope"
AndreasArvidsson f739ba3
Add test
pokey 518cd6e
Update cheat sheet
AndreasArvidsson bc474c9
Fix cheatsheet
pokey e02f039
Merge branch 'main' into glyph_modifier
pokey File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
from talon import Module | ||
|
||
mod = Module() | ||
|
||
mod.list( | ||
"cursorless_glyph_scope_type", | ||
desc="Cursorless glyph scope type", | ||
) | ||
mod.list( | ||
"cursorless_glyph_scope_type_plural", | ||
desc="Plural version of Cursorless glyph scope type", | ||
) | ||
|
||
|
||
@mod.capture(rule="{user.cursorless_glyph_scope_type} <user.any_alphanumeric_key>") | ||
def cursorless_glyph_scope_type(m) -> dict[str, str]: | ||
return { | ||
"type": "glyph", | ||
"character": m.any_alphanumeric_key, | ||
} | ||
|
||
|
||
@mod.capture( | ||
rule="{user.cursorless_glyph_scope_type_plural} <user.any_alphanumeric_key>" | ||
) | ||
def cursorless_glyph_scope_type_plural(m) -> dict[str, str]: | ||
return { | ||
"type": "glyph", | ||
"character": m.any_alphanumeric_key, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
...ages/cursorless-vscode-e2e/src/suite/fixtures/recorded/scope/glyph/clearEveryGlyphAir.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
languageId: plaintext | ||
command: | ||
version: 6 | ||
spokenForm: clear every glyph air | ||
action: | ||
name: clearAndSetSelection | ||
target: | ||
type: primitive | ||
modifiers: | ||
- type: everyScope | ||
scopeType: {type: glyph, character: a} | ||
usePrePhraseSnapshot: true | ||
spokenFormError: Scope type 'glyph' | ||
initialState: | ||
documentContents: abc$!4123a | ||
selections: | ||
- anchor: {line: 0, character: 0} | ||
active: {line: 0, character: 0} | ||
marks: {} | ||
finalState: | ||
documentContents: bc$!4123 | ||
selections: | ||
- anchor: {line: 0, character: 0} | ||
active: {line: 0, character: 0} | ||
- anchor: {line: 0, character: 8} | ||
active: {line: 0, character: 8} |
26 changes: 26 additions & 0 deletions
26
...ages/cursorless-vscode-e2e/src/suite/fixtures/recorded/scope/glyph/clearFinalGlyphAir.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
languageId: plaintext | ||
command: | ||
version: 6 | ||
spokenForm: clear final glyph air | ||
action: | ||
name: clearAndSetSelection | ||
target: | ||
type: primitive | ||
modifiers: | ||
- type: ordinalScope | ||
scopeType: {type: glyph, character: a} | ||
start: -1 | ||
length: 1 | ||
usePrePhraseSnapshot: true | ||
spokenFormError: Scope type 'glyph' | ||
initialState: | ||
documentContents: abc$!4123a | ||
selections: | ||
- anchor: {line: 0, character: 0} | ||
active: {line: 0, character: 0} | ||
marks: {} | ||
finalState: | ||
documentContents: abc$!4123 | ||
selections: | ||
- anchor: {line: 0, character: 9} | ||
active: {line: 0, character: 9} |
24 changes: 24 additions & 0 deletions
24
packages/cursorless-vscode-e2e/src/suite/fixtures/recorded/scope/glyph/clearGlyphAir.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
languageId: plaintext | ||
command: | ||
version: 6 | ||
spokenForm: clear glyph air | ||
action: | ||
name: clearAndSetSelection | ||
target: | ||
type: primitive | ||
modifiers: | ||
- type: containingScope | ||
scopeType: {type: glyph, character: a} | ||
usePrePhraseSnapshot: true | ||
spokenFormError: Scope type 'glyph' | ||
initialState: | ||
documentContents: abc$!4123a | ||
selections: | ||
- anchor: {line: 0, character: 0} | ||
active: {line: 0, character: 0} | ||
marks: {} | ||
finalState: | ||
documentContents: bc$!4123a | ||
selections: | ||
- anchor: {line: 0, character: 0} | ||
active: {line: 0, character: 0} |
27 changes: 27 additions & 0 deletions
27
...es/cursorless-vscode-e2e/src/suite/fixtures/recorded/scope/glyph/clearNextGlyphDollar.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
languageId: plaintext | ||
command: | ||
version: 6 | ||
spokenForm: clear next glyph dollar | ||
action: | ||
name: clearAndSetSelection | ||
target: | ||
type: primitive | ||
modifiers: | ||
- type: relativeScope | ||
scopeType: {type: glyph, character: $} | ||
offset: 1 | ||
length: 1 | ||
direction: forward | ||
usePrePhraseSnapshot: true | ||
spokenFormError: Scope type 'glyph' | ||
initialState: | ||
documentContents: abc$!4123a | ||
selections: | ||
- anchor: {line: 0, character: 0} | ||
active: {line: 0, character: 0} | ||
marks: {} | ||
finalState: | ||
documentContents: abc!4123a | ||
selections: | ||
- anchor: {line: 0, character: 3} | ||
active: {line: 0, character: 3} |
27 changes: 27 additions & 0 deletions
27
...ages/cursorless-vscode-e2e/src/suite/fixtures/recorded/scope/glyph/clearNextGlyphOnyx.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
languageId: plaintext | ||
command: | ||
version: 6 | ||
spokenForm: clear next glyph onyx | ||
action: | ||
name: clearAndSetSelection | ||
target: | ||
type: primitive | ||
modifiers: | ||
- type: relativeScope | ||
scopeType: {type: glyph, character: å} | ||
offset: 1 | ||
length: 1 | ||
direction: forward | ||
usePrePhraseSnapshot: true | ||
spokenFormError: Scope type 'glyph' | ||
initialState: | ||
documentContents: abå | ||
selections: | ||
- anchor: {line: 0, character: 0} | ||
active: {line: 0, character: 0} | ||
marks: {} | ||
finalState: | ||
documentContents: ab | ||
selections: | ||
- anchor: {line: 0, character: 2} | ||
active: {line: 0, character: 2} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed