mirror of
https://github.com/nvim-treesitter/nvim-treesitter-context
synced 2024-09-16 22:24:04 +02:00
feat(c): Add switch and case support
This commit is contained in:
parent
85cf977181
commit
2972717355
2 changed files with 37 additions and 0 deletions
|
@ -38,3 +38,11 @@
|
|||
(enum_specifier
|
||||
body: (_ (_) @context.end)
|
||||
) @context
|
||||
|
||||
(switch_statement
|
||||
body: (_) @context.end
|
||||
) @context
|
||||
|
||||
(case_statement
|
||||
value: (_) (_) @context.end
|
||||
) @context
|
||||
|
|
29
test/test.c
29
test/test.c
|
@ -116,4 +116,33 @@ int main(int arg1,
|
|||
// comment
|
||||
|
||||
}
|
||||
|
||||
switch (arg1) {
|
||||
// comment
|
||||
// comment
|
||||
case 0:
|
||||
// comment
|
||||
// comment
|
||||
// comment
|
||||
// comment
|
||||
// comment
|
||||
// comment
|
||||
// comment
|
||||
// comment
|
||||
// comment
|
||||
// comment
|
||||
break;
|
||||
case 1: {
|
||||
// comment
|
||||
// comment
|
||||
// comment
|
||||
// comment
|
||||
// comment
|
||||
// comment
|
||||
// comment
|
||||
// comment
|
||||
// comment
|
||||
// comment
|
||||
} break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue