Skip to content

Commit b268a18

Browse files
committed
WIP
1 parent 374e4b0 commit b268a18

File tree

4 files changed

+14
-1
lines changed

4 files changed

+14
-1
lines changed

cursorless-talon/src/modifiers/containing_scope.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@
3939
"selector": "selector",
4040
"state": "statement",
4141
"string": "string",
42+
"subject": "subject",
43+
"branch": "branch",
4244
"type": "type",
4345
"value": "value",
4446
"condition": "condition",

schemas/cursorless-snippets.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,13 @@
7373
"argumentOrParameter",
7474
"anonymousFunction",
7575
"attribute",
76+
"branch",
7677
"class",
7778
"className",
7879
"collectionItem",
7980
"collectionKey",
8081
"comment",
82+
"condition",
8183
"functionCall",
8284
"functionName",
8385
"ifStatement",
@@ -88,6 +90,7 @@
8890
"regularExpression",
8991
"statement",
9092
"string",
93+
"subject",
9194
"type",
9295
"value",
9396
"condition",

src/languages/rust.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,8 @@ const nodeMatchers: Partial<
186186
"meta_arguments",
187187
"type_parameters"
188188
),
189+
collectionKey: ["match_pattern"],
190+
condition: ["match_pattern"],
189191
name: [
190192
"let_declaration.identifier!",
191193
"parameter.identifier!",
@@ -198,15 +200,18 @@ const nodeMatchers: Partial<
198200
"let_declaration[pattern]",
199201
"constrained_type_parameter[left]",
200202
"where_predicate[left]",
203+
"match_pattern",
201204
],
202205
class: ["struct_item", "struct_expression", "enum_item"],
203206
className: ["struct_item[name]", "enum_item[name]", "trait_item[name]"],
204207
value: cascadingMatcher(
205208
leadingMatcher(["let_declaration[value]"], ["="]),
206-
patternMatcher("meta_item[value]"),
209+
patternMatcher("meta_item[value]", "match_arm[value]"),
207210
matcher(returnValueFinder)
208211
),
209212
attribute: trailingMatcher(["mutable_specifier", "attribute_item"]),
213+
subject: "match_expression[value]",
214+
branch: "match_arm",
210215
};
211216

212217
export default createPatternMatchers(nodeMatchers);

src/typings/targetDescriptor.types.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,13 @@ export type SimpleScopeTypeType =
6969
| "argumentOrParameter"
7070
| "anonymousFunction"
7171
| "attribute"
72+
| "branch"
7273
| "class"
7374
| "className"
7475
| "collectionItem"
7576
| "collectionKey"
7677
| "comment"
78+
| "condition"
7779
| "functionCall"
7880
| "functionCallee"
7981
| "functionName"
@@ -96,6 +98,7 @@ export type SimpleScopeTypeType =
9698
| "sectionLevelFive"
9799
| "sectionLevelSix"
98100
| "selector"
101+
| "subject"
99102
| "xmlBothTags"
100103
| "xmlElement"
101104
| "xmlEndTag"

0 commit comments

Comments
 (0)