mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-18 11:20:07 -04:00
feat!: drop modules, general refactor and cleanup
This commit is contained in:
parent
310f0925ec
commit
692b051b09
1247 changed files with 6096 additions and 9074 deletions
42
runtime/queries/go/injections.scm
Normal file
42
runtime/queries/go/injections.scm
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
((comment) @injection.content
|
||||
(#set! injection.language "comment"))
|
||||
|
||||
(call_expression
|
||||
(selector_expression) @_function
|
||||
(#any-of? @_function
|
||||
"regexp.Match" "regexp.MatchReader" "regexp.MatchString" "regexp.Compile" "regexp.CompilePOSIX"
|
||||
"regexp.MustCompile" "regexp.MustCompilePOSIX")
|
||||
(argument_list
|
||||
.
|
||||
[
|
||||
(raw_string_literal
|
||||
(raw_string_literal_content) @injection.content)
|
||||
(interpreted_string_literal
|
||||
(interpreted_string_literal_content) @injection.content)
|
||||
]
|
||||
(#set! injection.language "regex")))
|
||||
|
||||
((comment) @injection.content
|
||||
(#match? @injection.content "/\\*!([a-zA-Z]+:)?re2c")
|
||||
(#set! injection.language "re2c"))
|
||||
|
||||
((call_expression
|
||||
function: (selector_expression
|
||||
field: (field_identifier) @_method)
|
||||
arguments: (argument_list
|
||||
.
|
||||
(interpreted_string_literal
|
||||
(interpreted_string_literal_content) @injection.content)))
|
||||
(#any-of? @_method "Printf" "Sprintf" "Fatalf" "Scanf" "Errorf" "Skipf" "Logf")
|
||||
(#set! injection.language "printf"))
|
||||
|
||||
((call_expression
|
||||
function: (selector_expression
|
||||
field: (field_identifier) @_method)
|
||||
arguments: (argument_list
|
||||
(_)
|
||||
.
|
||||
(interpreted_string_literal
|
||||
(interpreted_string_literal_content) @injection.content)))
|
||||
(#any-of? @_method "Fprintf" "Fscanf" "Appendf" "Sscanf")
|
||||
(#set! injection.language "printf"))
|
||||
Loading…
Add table
Add a link
Reference in a new issue