Skip to content

Commit a672947

Browse files
Added tests
1 parent 0d9e923 commit a672947

File tree

4 files changed

+55
-0
lines changed

4 files changed

+55
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
let foo, bar;
2+
---
3+
4+
[Range] = 0:4-0:12
5+
>--------<
6+
0| let foo, bar;
7+
8+
[Domain] = 0:0-0:13
9+
>-------------<
10+
0| let foo, bar;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
let foo, bar;
2+
---
3+
4+
[#1 Content] =
5+
[#1 Domain] = 0:4-0:7
6+
>---<
7+
0| let foo, bar;
8+
9+
[#1 Removal] = 0:4-0:9
10+
>-----<
11+
0| let foo, bar;
12+
13+
[#1 Trailing delimiter] = 0:7-0:9
14+
>--<
15+
0| let foo, bar;
16+
17+
[#1 Insertion delimiter] = ", "
18+
19+
20+
[#2 Content] =
21+
[#2 Domain] = 0:9-0:12
22+
>---<
23+
0| let foo, bar;
24+
25+
[#2 Removal] = 0:7-0:12
26+
>-----<
27+
0| let foo, bar;
28+
29+
[#2 Leading delimiter] = 0:7-0:9
30+
>--<
31+
0| let foo, bar;
32+
33+
[#2 Insertion delimiter] = ", "

packages/common/src/scopeSupportFacets/javascript.ts

+3
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,9 @@ export const javascriptCoreScopeSupport: LanguageScopeSupportFacetMap = {
112112
"value.return": supported,
113113
"value.return.lambda": supported,
114114
"value.field": supported,
115+
116+
"collectionItem.unenclosed": supported,
117+
"collectionItem.unenclosed.iteration": supported,
115118
};
116119

117120
export const javascriptJsxScopeSupport: LanguageScopeSupportFacetMap = {

queries/javascript.core.scm

+9
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,15 @@
285285
(#insertion-delimiter! @collectionItem ", ")
286286
)
287287

288+
;;!! let foo, bar;
289+
;;! ^^^^^^^^
290+
;;! -------------
291+
(lexical_declaration
292+
.
293+
(_) @collectionItem.iteration.start.startOf
294+
";"? @collectionItem.iteration.end.startOf
295+
) @collectionItem.iteration.domain
296+
288297
(expression_statement
289298
[
290299
;; name:

0 commit comments

Comments
 (0)