Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include interpolated SQL strings in Scala injection queries #9428

Merged
merged 3 commits into from
Jan 28, 2024
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion runtime/queries/scala/injections.scm
Original file line number Diff line number Diff line change
@@ -1,2 +1,16 @@
((comment) @injection.content
([(comment) (block_comment)] @injection.content
(#set! injection.language "comment"))


; TODO for some reason multiline string (triple quotes) interpolation works only if it contains interpolated value
; Matches these SQL interpolators:
; - Doobie: 'sql', 'fr'
; - Quill: 'sql', 'infix'
; - Slick: 'sql', 'sqlu'
(interpolated_string_expression
interpolator:
((identifier) @interpolator
(#match? @interpolator "^(fr|infix|sql|sqlu)$"))
(interpolated_string) @injection.content
jpaju marked this conversation as resolved.
Show resolved Hide resolved
(#set! injection.language "sql"))

Loading