From f1f106bac81c1ae5c971c52d3548d757fa4056b3 Mon Sep 17 00:00:00 2001 From: phanium Date: Tue, 24 Dec 2024 19:16:27 +0800 Subject: [PATCH] feat(c): add declaration support --- queries/c/context.scm | 4 ++++ test/lang/test.c | 12 ++++++++++++ 2 files changed, 16 insertions(+) diff --git a/queries/c/context.scm b/queries/c/context.scm index 86d17c14..a2a6682b 100644 --- a/queries/c/context.scm +++ b/queries/c/context.scm @@ -46,3 +46,7 @@ (case_statement value: (_) (_) @context.end ) @context + +(declaration + declarator: (_ (_) @content.end) +) @context diff --git a/test/lang/test.c b/test/lang/test.c index cb3e3651..2c8ff325 100644 --- a/test/lang/test.c +++ b/test/lang/test.c @@ -88,3 +88,15 @@ void baz(int a) { // {{CONTEXT}} } break; } } + +// {{TEST}} +void declaration() { // {{CONTEXT}} + struct Bert foo = { // {{CONTEXT}} + .f1 = 0, + + + // {{CURSOR}} + .f2 = 0, + + }; +}