File tree Expand file tree Collapse file tree 3 files changed +29
-2
lines changed Expand file tree Collapse file tree 3 files changed +29
-2
lines changed Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ def get_modifiers():
22
22
"extendThroughStartOf" ,
23
23
"extendThroughEndOf" ,
24
24
"every" ,
25
+ "ancestor" ,
25
26
"first" ,
26
27
"last" ,
27
28
"previous" ,
@@ -101,6 +102,16 @@ def get_modifiers():
101
102
},
102
103
],
103
104
},
105
+ {
106
+ "id" : "ancestor" ,
107
+ "type" : "modifier" ,
108
+ "variations" : [
109
+ {
110
+ "spokenForm" : f"{ complex_modifiers ['ancestor' ]} <scope>" ,
111
+ "description" : "Grandparent containing instance of <scope>" ,
112
+ },
113
+ ],
114
+ },
104
115
{
105
116
"id" : "relativeScope" ,
106
117
"type" : "modifier" ,
Original file line number Diff line number Diff line change 15
15
)
16
16
def cursorless_simple_scope_modifier (m ) -> dict [str , Any ]:
17
17
"""Containing scope, every scope, etc"""
18
+ if hasattr (m , "cursorless_simple_scope_modifier" ):
19
+ modifier = m .cursorless_simple_scope_modifier
20
+
21
+ if modifier == "every" :
22
+ return {
23
+ "type" : "everyScope" ,
24
+ "scopeType" : m .cursorless_scope_type ,
25
+ }
26
+
27
+ if modifier == "ancestor" :
28
+ return {
29
+ "type" : "containingScope" ,
30
+ "scopeType" : m .cursorless_scope_type ,
31
+ "ancestorIndex" : 1 ,
32
+ }
33
+
18
34
return {
19
- "type" : "everyScope" if m [ 0 ] == "every" else " containingScope" ,
35
+ "type" : "containingScope" ,
20
36
"scopeType" : m .cursorless_scope_type ,
21
37
}
Original file line number Diff line number Diff line change 81
81
"its" : " inferPreviousMark" ,
82
82
"visible" : " visible"
83
83
},
84
- "simple_scope_modifier" : { "every" : " every" },
84
+ "simple_scope_modifier" : { "every" : " every" , "grand" : " ancestor " },
85
85
"interior_modifier" : {
86
86
"inside" : " interiorOnly"
87
87
},
You can’t perform that action at this time.
0 commit comments