Skip to content

Commit

Permalink
feat(c): add declaration support
Browse files Browse the repository at this point in the history
  • Loading branch information
phanen authored and lewis6991 committed Jan 6, 2025
1 parent dd02e54 commit f1f106b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions queries/c/context.scm
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,7 @@
(case_statement
value: (_) (_) @context.end
) @context

(declaration
declarator: (_ (_) @content.end)
) @context
12 changes: 12 additions & 0 deletions test/lang/test.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,15 @@ void baz(int a) { // {{CONTEXT}}
} break;
}
}

// {{TEST}}
void declaration() { // {{CONTEXT}}
struct Bert foo = { // {{CONTEXT}}
.f1 = 0,


// {{CURSOR}}
.f2 = 0,

};
}

0 comments on commit f1f106b

Please sign in to comment.