Skip to content

Commit

Permalink
add map support
Browse files Browse the repository at this point in the history
  • Loading branch information
sonnyvesali committed Nov 9, 2024
1 parent 99b61a6 commit 60c38c5
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 3 deletions.
25 changes: 25 additions & 0 deletions data/fixtures/scopes/dart/map.scope
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
final map = {
'hi': 1,
};
---

[Content] =
[Domain] = 0:14-2:3
>-
0| final map = {
1| 'hi': 1,
2| };
---<

[Removal] = 0:13-2:3
>--
0| final map = {
1| 'hi': 1,
2| };
---<

[Leading delimiter] = 0:13-0:14
>-<
0| final map = {

[Insertion delimiter] = " "
8 changes: 6 additions & 2 deletions data/playground/dart.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
foo() {
if (true) { }
if (true) {}

final list = [1,2,3];
final list = [1, 2, 3];

final map = {
'hi': 1,
};
}
1 change: 1 addition & 0 deletions packages/common/src/scopeSupportFacets/dart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ const { supported, unsupported, notApplicable } = ScopeSupportFacetLevel;
export const dartScopeSupport: LanguageScopeSupportFacetMap = {
ifStatement: supported,
list: supported,
map: supported,
};
9 changes: 8 additions & 1 deletion queries/dart.scm
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,11 @@
[
(list_literal)
(list_pattern)
] @list
] @list

;;!! { value: 0 }
;;! ^^^^^^^^^^^^
[
(set_or_map_literal)
(map_pattern)
] @map

0 comments on commit 60c38c5

Please sign in to comment.