Skip to content

Commit

Permalink
Include interpolated SQL strings in Scala injection queries (helix-ed…
Browse files Browse the repository at this point in the history
…itor#9428)

* Change Scala injection queries to include SQL strings

* Include block comments in comment injection

* Change #match predicate to #any-of

Co-authored-by: Kirawi <[email protected]>

---------

Co-authored-by: Kirawi <[email protected]>
  • Loading branch information
2 people authored and Vulpesx committed Jun 7, 2024
1 parent 7de78c3 commit 155e13f
Showing 1 changed file with 15 additions and 1 deletion.
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
(#any-of? @interpolator "fr" "infix" "sql" "sqlu"))
(interpolated_string) @injection.content
(#set! injection.language "sql"))

0 comments on commit 155e13f

Please sign in to comment.