From ff83f082434f9ee876de25054f0e3f8467e82db8 Mon Sep 17 00:00:00 2001 From: Finn Evers Date: Wed, 25 Feb 2026 16:46:27 +0100 Subject: [PATCH] python: Fix warning in injections query (#49397) Release Notes: - N/A --- crates/languages/src/python/injections.scm | 50 +++++++++------------- 1 file changed, 21 insertions(+), 29 deletions(-) diff --git a/crates/languages/src/python/injections.scm b/crates/languages/src/python/injections.scm index d8470140e999f3dc649c0a498987cfae7df6bf59..bc47469dc870c4dec13f4c30fafc8a2fb29749fd 100644 --- a/crates/languages/src/python/injections.scm +++ b/crates/languages/src/python/injections.scm @@ -1,34 +1,26 @@ ((comment) @injection.content - (#set! injection.language "comment") -) + (#set! injection.language "comment")) ; SQL ----------------------------------------------------------------------------- -( +([ + ; function calls + (call [ - ; function calls - (call - [ - (attribute attribute: (identifier) @function_name) - (identifier) @function_name - ] - arguments: (argument_list - (comment) @comment - (string - (string_content) @injection.content - ) - )) - - ; string variables - ((comment) @comment - . - (expression_statement - (assignment - right: (string - (string_content) @injection.content - ) - ) - )) + (attribute + attribute: (identifier)) + (identifier) ] - (#match? @comment "^(#|#\\s+)(?i:sql)\\s*$") - (#set! injection.language "sql") -) + arguments: (argument_list + (comment) @_comment + (string + (string_content) @injection.content))) + ; string variables + ((comment) @_comment + . + (expression_statement + (assignment + right: (string + (string_content) @injection.content)))) +] + (#match? @_comment "^(#|#\\s+)(?i:sql)\\s*$") + (#set! injection.language "sql"))