diff --git a/after/queries/go/injections.scm b/after/queries/go/injections.scm index 66fc8ac..6a249aa 100644 --- a/after/queries/go/injections.scm +++ b/after/queries/go/injections.scm @@ -1,4 +1,4 @@ -;; extends +;; extends match Query and json ( (const_spec name: (identifier) @_id @@ -7,6 +7,30 @@ (#contains? @_id "Query") ) +( + (const_spec + name: (identifier) @_id + value: (expression_list (raw_string_literal) @json)) + + (#contains? @_id "Json") +) + + +(short_var_declaration + left: (expression_list + (identifier) @_id (#match? @_id "Query")) + right: (expression_list + (raw_string_literal) @sql (#offset! @sql 0 1 0 -1)) +) + + +(short_var_declaration + left: (expression_list + (identifier) @_id (#match? @_id "Json")) + right: (expression_list + (raw_string_literal) @json (#offset! @json 0 1 0 -1)) +) + ((composite_literal type: (type_identifier) @_type body: (literal_value