File tree Expand file tree Collapse file tree 2 files changed +62
-0
lines changed Expand file tree Collapse file tree 2 files changed +62
-0
lines changed Original file line number Diff line number Diff line change 41
41
"reveal" : " never"
42
42
},
43
43
"group" : " build"
44
+ },
45
+ {
46
+ "label" : " Parse quarry" ,
47
+ "type" : " shell" ,
48
+ "command" : " npx tree-sitter query scopeTypes.scm ts-test.ts" ,
49
+ "presentation" : {}
44
50
}
45
51
]
46
52
}
Original file line number Diff line number Diff line change
1
+ (object) @map
2
+
3
+ (arrow_function) @anonymousFunction
4
+ (function) @anonymousFunction
5
+
6
+ ; We could also have used an alternation here, but the above style is clean and
7
+ ; seems to be more commonly used.
8
+ ; [
9
+ ; (arrow_function)
10
+ ; (function)
11
+ ; ] @anonymousFunction
12
+
13
+ ; The following doesn't work because we can't have a `(` before the field name (`key`)
14
+ ; (
15
+ ; (object
16
+ ; (pair
17
+ ; (key: (_) @key
18
+ ; .
19
+ ; ":") @key.removalRange
20
+ ; ) @key.searchScope
21
+ ; ) @key.iterationScope
22
+ ; )
23
+
24
+ ; As a workaround, we could allow defining the end of an annotation
25
+ (
26
+ (object
27
+ (pair
28
+ key: (_) @key
29
+ .
30
+ " :" @key.removalRange.end
31
+ ) @key.searchScope
32
+ ) @key.iterationScope
33
+ )
34
+
35
+ ; We could instead tag the delimiter itself. Gives us a bit more information,
36
+ ; so maybe that's better?
37
+ (
38
+ (object
39
+ (pair
40
+ key: (_) @key
41
+ .
42
+ " :" @key.delimiter.trailing)
43
+ @key.searchScope)
44
+ @key.iterationScope)
45
+
46
+ ; We could also try setting an attribute. This approach is likely how we'd
47
+ ; handle comma-separated lists, because they'd be a bit painful to define as
48
+ ; parse tree patterns
49
+ (
50
+ (object
51
+ (pair
52
+ key: (_) @key
53
+ (#set! " delimiter" " :" )
54
+ )
55
+ @key.searchScope)
56
+ @key.iterationScope)
You can’t perform that action at this time.
0 commit comments