Skip to content

Commit

Permalink
golang highlight sql strings in query methods
Browse files Browse the repository at this point in the history
  • Loading branch information
topi314 committed Jun 23, 2024
1 parent d7b50e3 commit 2d15c85
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions config/queries/go/injections.scm
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,15 @@
(interpreted_string_literal) @injection.content))
(#any-of? @_method "Fprintf" "Fscanf" "Appendf" "Sscanf")
(#set! injection.language "printf"))

(call_expression
(selector_expression) @_function
(#match? @_function "^[a-zA-Z_][a-zA-Z0-9_]*.(Query|Exec|Prepare|Get|Select)(Context)?$")
(argument_list
.
[
(raw_string_literal)
(interpreted_string_literal)
] @injection.content
(#offset! @injection.content 0 1 0 -1)
(#set! injection.language "sql")))

0 comments on commit 2d15c85

Please sign in to comment.