working nvf!
This commit is contained in:
parent
5548480371
commit
2a80c2bac1
53 changed files with 330 additions and 172 deletions
30
modules/editors/nvf/runtime/after/queries/go/injections.scm
Normal file
30
modules/editors/nvf/runtime/after/queries/go/injections.scm
Normal file
|
@ -0,0 +1,30 @@
|
|||
; extends
|
||||
|
||||
; inject sql into any const string with word query in the name
|
||||
; e.g. const query = `SELECT * FROM users WHERE name = 'John'`;
|
||||
(const_spec
|
||||
name: (identifier) @_name (#match? @_name "[Qq]uery")
|
||||
value: (expression_list
|
||||
(raw_string_literal) @injection.content)
|
||||
(#offset! @injection.content 0 1 0 -1)
|
||||
(#set! injection.language "sql"))
|
||||
|
||||
; inject sql in single line strings
|
||||
(call_expression
|
||||
(selector_expression
|
||||
field: (field_identifier) @_field (#any-of? @_field "GetContext" "Get" "ExecContext" "Exec" "SelectContext" "Select" "In" "Rebind"))
|
||||
(argument_list
|
||||
(raw_string_literal) @injection.content)
|
||||
(#offset! @injection.content 0 1 0 -1)
|
||||
(#set! injection.language "sql")
|
||||
)
|
||||
|
||||
; inject sql in multi line strings
|
||||
(call_expression
|
||||
(selector_expression
|
||||
field: (field_identifier) @_field (#any-of? @_field "GetContext" "Get" "ExecContext" "Exec" "SelectContext" "Select" "In" "Rebind"))
|
||||
(argument_list
|
||||
(interpreted_string_literal) @injection.content)
|
||||
(#offset! @injection.content 0 1 0 -1)
|
||||
(#set! injection.language "sql")
|
||||
)
|
|
@ -0,0 +1,2 @@
|
|||
;; extends
|
||||
(( jsx_text ) @injection.content (#set! injection.language "markdown") )
|
|
@ -0,0 +1,5 @@
|
|||
;extends
|
||||
|
||||
(fenced_code_block (code_fence_content) @class.inner) @class.outer
|
||||
|
||||
(paragraph) @function.outer @function.inner
|
|
@ -0,0 +1,12 @@
|
|||
;extends
|
||||
|
||||
[
|
||||
(shortcut_link)
|
||||
] @nospell
|
||||
|
||||
(strikethrough
|
||||
(emphasis_delimiter)
|
||||
(strikethrough
|
||||
(emphasis_delimiter)
|
||||
(emphasis_delimiter))
|
||||
(emphasis_delimiter))@markup.doublestrikethrough
|
|
@ -0,0 +1,9 @@
|
|||
((jsx_section)
|
||||
@injection.content
|
||||
(#set! injection.language "tsx")
|
||||
(#set! injection.include-children))
|
||||
|
||||
((markdown_section)
|
||||
@injection.content
|
||||
(#set! injection.language "markdown")
|
||||
(#set! injection.combined))
|
|
@ -0,0 +1,14 @@
|
|||
;extends
|
||||
(macro_invocation
|
||||
(scoped_identifier
|
||||
path: (identifier) @path (#eq? @path "sqlx")
|
||||
name: (identifier) @name (#match? @name "^query.*")
|
||||
)
|
||||
|
||||
(token_tree
|
||||
(raw_string_literal) @injection.content
|
||||
(#set! injection.language "sql")
|
||||
(#set! injection.include-children)
|
||||
)
|
||||
(#offset! @injection.content 0 3 0 -2)
|
||||
)
|
|
@ -0,0 +1,5 @@
|
|||
;; extends
|
||||
((ident) @constant
|
||||
(#eq? @constant "lambda")
|
||||
(#set! conceal "λ")
|
||||
)
|
Loading…
Add table
Add a link
Reference in a new issue