From 78b54eb7f6a9956d25a3911fa0dfd0cabfe2a4c5 Mon Sep 17 00:00:00 2001 From: Pham Huy Hoang Date: Wed, 3 May 2023 19:07:59 +0900 Subject: chore(injections)!: update injection syntax to 0.9 Since 0.9, @lang syntax is still available as fallback but will soon be deprecated. Because of that, new syntax should be adopted once 0.9 becomes the baseline requirements for nvim-treesitter - update health check - update doc --- queries/c/injections.scm | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) (limited to 'queries/c') diff --git a/queries/c/injections.scm b/queries/c/injections.scm index 2ef8f85c1..a1913e664 100644 --- a/queries/c/injections.scm +++ b/queries/c/injections.scm @@ -1,10 +1,21 @@ -((preproc_def (preproc_arg) @c) - (#lua-match? @c "\n")) -(preproc_function_def (preproc_arg) @c) -(preproc_call (preproc_arg) @c) +((preproc_def + (preproc_arg) @injection.content) + (#lua-match? @injection.content "\n") + (#set! injection.language "c")) -(comment) @comment +(preproc_function_def + (preproc_arg) @injection.content + (#set! injection.language "c")) + +(preproc_call + (preproc_arg) @injection.content + (#set! injection.language "c")) + +((comment) @injection.content + (#set! injection.language "comment")) ; TODO: add when asm is added -; (gnu_asm_expression assembly_code: (string_literal) @asm) -; (gnu_asm_expression assembly_code: (concatenated_string (string_literal) @asm)) +; (gnu_asm_expression assembly_code: (string_literal) @injection.content +; (#set! injection.language "asm")) +; (gnu_asm_expression assembly_code: (concatenated_string (string_literal) @injection.content) +; (#set! injection.language "asm")) -- cgit v1.2.3-70-g09d2