File tree Expand file tree Collapse file tree 2 files changed +26
-14
lines changed
packages/cursorless-engine/src/languages Expand file tree Collapse file tree 2 files changed +26
-14
lines changed Original file line number Diff line number Diff line change 66 argumentMatcher ,
77 cascadingMatcher ,
88 createPatternMatchers ,
9- leadingMatcher ,
109 patternMatcher ,
1110} from "../util/nodeMatchers" ;
1211
@@ -146,14 +145,5 @@ const nodeMatchers: Partial<
146145 "block_parameters" ,
147146 "argument_list" ,
148147 ) ,
149- value : leadingMatcher (
150- [
151- "pair[value]" ,
152- "assignment[right]" ,
153- "operator_assignment[right]" ,
154- "return.argument_list!" ,
155- ] ,
156- assignmentOperators . concat ( mapKeyValueSeparators ) ,
157- ) ,
158148} ;
159149export const patternMatchers = createPatternMatchers ( nodeMatchers ) ;
Original file line number Diff line number Diff line change @@ -139,11 +139,33 @@ operator: [
139139;; ! ^^^
140140;; ! ^^^^^
141141(pair
142- key: (_) @collectionKey
143- value: (_) @collectionKey.trailing.startOf
142+ key: (_) @collectionKey @value.leading.endOf
143+ value: (_) @value @ collectionKey.trailing.startOf
144144) @_.domain
145145
146+ ;; !! {"1" => "one", "2" => "two"}
147+ ;; ! ^^^^^^^^^^^^^^^^^^^^^^^^^^
146148(hash
147- "{" @collectionKey.iteration.start.endOf
148- "}" @collectionKey.iteration.end.startOf
149+ "{" @collectionKey.iteration.start.endOf @value.iteration.start.endOf
150+ "}" @collectionKey.iteration.end.startOf @value.iteration.end.startOf
149151)
152+
153+ ;; !! return 10
154+ ;; ! ^^
155+ (return
156+ (argument_list) @value
157+ ) @_.domain
158+
159+ ;; !! a = 10
160+ ;; ! ^^
161+ (assignment
162+ left: (_) @_.leading.endOf
163+ right: (_) @value
164+ ) @_.domain
165+
166+ ;; !! a += 10
167+ ;; ! ^^
168+ (operator_assignment
169+ left: (_) @_.leading.endOf
170+ right: (_) @value
171+ ) @_.domain
You can’t perform that action at this time.
0 commit comments