Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions data/fixtures/scopes/dart/class.scope
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
class MyClass {

}
---

[Content] =
[Removal] =
[Domain] = 0:0-2:1
>---------------
0| class MyClass {
1|
2| }
-<

[Insertion delimiter] = "\n\n"
29 changes: 29 additions & 0 deletions data/fixtures/scopes/dart/className.scope
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
class MyClass {

}
---

[Content] = 0:6-0:13
>-------<
0| class MyClass {

[Removal] = 0:6-0:14
>--------<
0| class MyClass {

[Leading delimiter] = 0:5-0:6
>-<
0| class MyClass {

[Trailing delimiter] = 0:13-0:14
>-<
0| class MyClass {

[Domain] = 0:0-2:1
>---------------
0| class MyClass {
1|
2| }
-<

[Insertion delimiter] = " "
15 changes: 14 additions & 1 deletion data/playground/dart.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,22 @@
foo() {
if (true) {}
final hi = '';
if (hi.isNotEmpty) {

//
}


else if (true) {
//
}

final list = [1, 2, 3];

final map = {
'hi': 1,
};
}

class Something{

}
2 changes: 2 additions & 0 deletions packages/common/src/scopeSupportFacets/dart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,6 @@ export const dartScopeSupport: LanguageScopeSupportFacetMap = {
ifStatement: supported,
list: supported,
map: supported,
class: supported,
className: supported,
};
8 changes: 7 additions & 1 deletion queries/dart.scm
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

;;!! if () {}
;;! ^^^^^^^^
(if_statement) @ifStatement
Expand All @@ -16,3 +15,10 @@
(set_or_map_literal)
(map_pattern)
] @map

;;!! class Foo {}
;;! ^^^^^^^^^^^^

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this empty line shouldn't appear. Have you installed all the recommended extensions? In particular, Andreas's vscode extension should autoformat .scm files. Though maybe you need to configure it to be the formatter for .scm files?

(class_definition
name: (_) @className
) @class @className.domain
Loading