Skip to content

Commit 60c38c5

Browse files
committed
add map support
1 parent 99b61a6 commit 60c38c5

File tree

4 files changed

+40
-3
lines changed

4 files changed

+40
-3
lines changed

data/fixtures/scopes/dart/map.scope

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
final map = {
2+
'hi': 1,
3+
};
4+
---
5+
6+
[Content] =
7+
[Domain] = 0:14-2:3
8+
>-
9+
0| final map = {
10+
1| 'hi': 1,
11+
2| };
12+
---<
13+
14+
[Removal] = 0:13-2:3
15+
>--
16+
0| final map = {
17+
1| 'hi': 1,
18+
2| };
19+
---<
20+
21+
[Leading delimiter] = 0:13-0:14
22+
>-<
23+
0| final map = {
24+
25+
[Insertion delimiter] = " "

data/playground/dart.dart

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
foo() {
2-
if (true) { }
2+
if (true) {}
33

4-
final list = [1,2,3];
4+
final list = [1, 2, 3];
5+
6+
final map = {
7+
'hi': 1,
8+
};
59
}

packages/common/src/scopeSupportFacets/dart.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ const { supported, unsupported, notApplicable } = ScopeSupportFacetLevel;
77
export const dartScopeSupport: LanguageScopeSupportFacetMap = {
88
ifStatement: supported,
99
list: supported,
10+
map: supported,
1011
};

queries/dart.scm

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,11 @@
88
[
99
(list_literal)
1010
(list_pattern)
11-
] @list
11+
] @list
12+
13+
;;!! { value: 0 }
14+
;;! ^^^^^^^^^^^^
15+
[
16+
(set_or_map_literal)
17+
(map_pattern)
18+
] @map

0 commit comments

Comments
 (0)