Skip to content

Commit

Permalink
renaming treesitter node for injections
Browse files Browse the repository at this point in the history
  • Loading branch information
ray-x committed Dec 1, 2024
1 parent 1fd307b commit c852da0
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions queries/go/injections.scm
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,17 @@

; neovim nightly 0.10
([
(interpreted_string_literal)
(raw_string_literal)
(interpreted_string_literal_content)
(raw_string_literal_content)
] @injection.content
(#match? @injection.content "(SELECT|select|INSERT|insert|UPDATE|update|DELETE|delete).+(FROM|from|INTO|into|VALUES|values|SET|set).*(WHERE|where|GROUP BY|group by)?")
(#offset! @injection.content 0 1 0 -1)
(#set! injection.language "sql"))

; a general query injection
([
(interpreted_string_literal)
(raw_string_literal)
(interpreted_string_literal_content)
(raw_string_literal_content)
] @sql
(#match? @sql "(SELECT|select|INSERT|insert|UPDATE|update|DELETE|delete).+(FROM|from|INTO|into|VALUES|values|SET|set).*(WHERE|where|GROUP BY|group by)?")
(#offset! @sql 0 1 0 -1))
Expand All @@ -42,8 +42,8 @@
; fallback keyword and comment based injection

([
(interpreted_string_literal)
(raw_string_literal)
(interpreted_string_literal_content)
(raw_string_literal_content)
] @sql
(#contains? @sql "-- sql" "--sql" "ADD CONSTRAINT" "ALTER TABLE" "ALTER COLUMN"
"DATABASE" "FOREIGN KEY" "GROUP BY" "HAVING" "CREATE INDEX" "INSERT INTO"
Expand All @@ -53,8 +53,8 @@

; nvim 0.10
([
(interpreted_string_literal)
(raw_string_literal)
(interpreted_string_literal_content)
(raw_string_literal_content)
] @injection.content
(#contains? @injection.content "-- sql" "--sql" "ADD CONSTRAINT" "ALTER TABLE" "ALTER COLUMN"
"DATABASE" "FOREIGN KEY" "GROUP BY" "HAVING" "CREATE INDEX" "INSERT INTO"
Expand Down

0 comments on commit c852da0

Please sign in to comment.