Skip to content

Commit 48c4fdb

Browse files
committed
add class support
1 parent effff0d commit 48c4fdb

File tree

5 files changed

+68
-1
lines changed

5 files changed

+68
-1
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
class MyClass {
2+
3+
}
4+
---
5+
6+
[Content] =
7+
[Removal] =
8+
[Domain] = 0:0-2:1
9+
>---------------
10+
0| class MyClass {
11+
1|
12+
2| }
13+
-<
14+
15+
[Insertion delimiter] = "\n\n"
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
class MyClass {
2+
3+
}
4+
---
5+
6+
[Content] =
7+
[Domain] = 0:6-0:13
8+
>-------<
9+
0| class MyClass {
10+
11+
[Removal] = 0:6-0:14
12+
>--------<
13+
0| class MyClass {
14+
15+
[Leading delimiter] = 0:5-0:6
16+
>-<
17+
0| class MyClass {
18+
19+
[Trailing delimiter] = 0:13-0:14
20+
>-<
21+
0| class MyClass {
22+
23+
[Insertion delimiter] = " "

data/playground/dart.dart

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,22 @@
11
foo() {
2-
if (true) {}
2+
final hi = '';
3+
if (hi.isNotEmpty) {
4+
5+
//
6+
}
7+
8+
9+
else if (true) {
10+
//
11+
}
312

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

615
final map = {
716
'hi': 1,
817
};
918
}
19+
20+
class Something{
21+
22+
}

packages/common/src/scopeSupportFacets/dart.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,6 @@ export const dartScopeSupport: LanguageScopeSupportFacetMap = {
88
ifStatement: supported,
99
list: supported,
1010
map: supported,
11+
class: supported,
12+
className: supported,
1113
};

queries/dart.scm

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,17 @@
1616
(set_or_map_literal)
1717
(map_pattern)
1818
] @map
19+
20+
;;!! class Foo {}
21+
;;! ^^^^^^^^^^^^
22+
(
23+
[
24+
(class_definition
25+
name: (_) @className
26+
)
27+
(class_definition
28+
29+
name: (_) @className
30+
)
31+
] @class
32+
)

0 commit comments

Comments
 (0)