Skip to content

Commit 3eb7f1b

Browse files
Made python match a cursorless statement scope (#1907)
## Checklist - [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
1 parent 3b38e7b commit 3eb7f1b

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
languageId: python
2+
command:
3+
version: 6
4+
spokenForm: change state
5+
action:
6+
name: clearAndSetSelection
7+
target:
8+
type: primitive
9+
modifiers:
10+
- type: containingScope
11+
scopeType: {type: statement}
12+
usePrePhraseSnapshot: true
13+
initialState:
14+
documentContents: |-
15+
match value:
16+
case 0:
17+
pass
18+
selections:
19+
- anchor: {line: 0, character: 0}
20+
active: {line: 0, character: 0}
21+
marks: {}
22+
finalState:
23+
documentContents: ""
24+
selections:
25+
- anchor: {line: 0, character: 0}
26+
active: {line: 0, character: 0}

queries/python.scm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
(if_statement)
1818
(import_from_statement)
1919
(import_statement)
20+
(match_statement)
2021
(nonlocal_statement)
2122
(pass_statement)
2223
(print_statement)

0 commit comments

Comments
 (0)