Skip to content

Commit 8a68de7

Browse files
Exclude binary operator from Talon name and value scopes (#2767)
Fixes #1781 ## 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 181cd9f commit 8a68de7

File tree

4 files changed

+54
-10
lines changed

4 files changed

+54
-10
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
aaa [bbb]: bbb or ""
2+
---
3+
4+
[Content] =
5+
[Removal] = 0:0-0:9
6+
>---------<
7+
0| aaa [bbb]: bbb or ""
8+
9+
[Domain] = 0:0-0:20
10+
>--------------------<
11+
0| aaa [bbb]: bbb or ""
12+
13+
[Insertion delimiter] = " "
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
aaa [bbb]: bbb or ""
2+
---
3+
4+
[Content] = 0:11-0:20
5+
>---------<
6+
0| aaa [bbb]: bbb or ""
7+
8+
[Removal] = 0:10-0:20
9+
>----------<
10+
0| aaa [bbb]: bbb or ""
11+
12+
[Leading delimiter] = 0:10-0:11
13+
>-<
14+
0| aaa [bbb]: bbb or ""
15+
16+
[Domain] = 0:0-0:20
17+
>--------------------<
18+
0| aaa [bbb]: bbb or ""
19+
20+
[Insertion delimiter] = " "

packages/common/src/scopeSupportFacets/talon.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,6 @@ const { supported } = ScopeSupportFacetLevel;
55

66
export const talonScopeSupport: LanguageScopeSupportFacetMap = {
77
command: supported,
8+
"name.field": supported,
9+
"value.field": supported,
810
};

queries/talon.scm

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,28 +39,37 @@
3939
;;! ^^^^------------
4040
;;!! tag(): user.cursorless
4141
;;! ^^^^^-----------------
42-
(_
43-
left: _ @name
44-
) @_.domain
42+
(
43+
(_
44+
left: _ @name
45+
) @_.domain
46+
(#not-type? @_.domain "binary_operator")
47+
)
4548

4649
;;!! not mode: command
4750
;;! ^^^^^^^^---------
4851
;;!! slap: key(enter)
4952
;;! ^^^^------------
5053
;;!! tag(): user.cursorless
5154
;;! ^^^^^-----------------
52-
(_
53-
modifiers: (_)? @collectionKey.start
54-
left: _ @collectionKey.end
55-
) @_.domain
55+
(
56+
(_
57+
modifiers: (_)? @collectionKey.start
58+
left: _ @collectionKey.end
59+
) @_.domain
60+
(#not-type? @_.domain "binary_operator")
61+
)
5662

5763
;;!! not mode: command
5864
;;! ----------^^^^^^^
5965
;;!! slap: key(enter)
6066
;;! ------^^^^^^^^^^
61-
(_
62-
right: (_) @value
63-
) @_.domain
67+
(
68+
(_
69+
right: (_) @value
70+
) @_.domain
71+
(#not-type? @_.domain "binary_operator")
72+
)
6473

6574
;;!! mode: command
6675
;;! <*************

0 commit comments

Comments
 (0)