File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change 51
51
[(string_literal) (raw_string_literal)] @injection.content
52
52
)
53
53
(#set! injection.language " sql" ))
54
+
55
+ ; Highlight SQL in `sqlx::query_unchecked!()`
56
+ (macro_invocation
57
+ macro: (scoped_identifier
58
+ path: (identifier) @_sqlx (#eq? @_sqlx " sqlx" )
59
+ name: (identifier) @_query_as (#eq? @_query_as " query_unchecked" ))
60
+ (token_tree
61
+ ; Only the first argument is SQL
62
+ .
63
+ [(string_literal) (raw_string_literal)] @injection.content
64
+ )
65
+ (#set! injection.language " sql" ))
66
+
67
+ ; Highlight SQL in `sqlx::query_as_unchecked!()`
68
+ (macro_invocation
69
+ macro: (scoped_identifier
70
+ path: (identifier) @_sqlx (#eq? @_sqlx " sqlx" )
71
+ name: (identifier) @_query_as (#eq? @_query_as " query_as_unchecked" ))
72
+ (token_tree
73
+ ; Only the second argument is SQL
74
+ .
75
+ ; Allow anything as the first argument in case the user has lower case type
76
+ ; names for some reason
77
+ (_)
78
+ [(string_literal) (raw_string_literal)] @injection.content
79
+ )
80
+ (#set! injection.language " sql" ))
You can’t perform that action at this time.
0 commit comments