Skip to content

Commit

Permalink
feat: multiline support
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomas Nemec authored and lewis6991 committed Dec 16, 2023
1 parent cfa8ee1 commit c8e81cb
Show file tree
Hide file tree
Showing 2 changed files with 164 additions and 12 deletions.
36 changes: 29 additions & 7 deletions queries/dart/context.scm
Original file line number Diff line number Diff line change
@@ -1,7 +1,29 @@
([
(class_definition)
(try_statement)
(if_statement)
(function_body)
(for_statement)
] @context)
(function_body) @context

(for_statement
body: (_) @context.end
) @context

(while_statement
body: (_) @context.end
) @context

(do_statement
body: (_) @context.end
) @context

(try_statement
body: (_) @context.end
) @context

(if_statement
consequence: (_) @context.end
) @context

(class_definition
body: (_) @context.end
) @context

(extension_declaration
body: (_) @context.end
) @context
140 changes: 135 additions & 5 deletions test/test.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@

class User {
@Deprecated('')
abstract
class User
extends
Object {
User(this.age);
int age;

Expand Down Expand Up @@ -34,14 +37,22 @@ class User {

}

String (int magicalNumber) {
if (magicalNumber == "69") {
String(
int magicalNumber,
) {
if (magicalNumber == "69"
// --
||
magicalNumber == "420") {
return 'pretty nice';




} else if (magicalNumber == "420"){
} else if (magicalNumber == "420" // -
&&
magicalNumber == "69") {




Expand All @@ -66,4 +77,123 @@ String (int magicalNumber) {
return 'pretty high';
}
return 'just decent';
}


void catching() {
try
// --
{














} catch (e) {










} finally {












}
}

void foring() {
for (int i = 0; // -
i < 10;
i++) {














}

while (true // --
== false) {


















}

do {














} while (true);
}

extension ext
on int {









}

0 comments on commit c8e81cb

Please sign in to comment.