mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 11:06:54 -04:00
fix(kotlin): regex and printf injections not applying (#8613)
This commit is contained in:
parent
f059649bc3
commit
da8bf82a53
1 changed files with 8 additions and 4 deletions
|
|
@ -8,7 +8,8 @@
|
||||||
; - "[abc]?".toRegex()
|
; - "[abc]?".toRegex()
|
||||||
(call_expression
|
(call_expression
|
||||||
(navigation_expression
|
(navigation_expression
|
||||||
((string_literal) @injection.content
|
((string_literal
|
||||||
|
(string_content) @injection.content)
|
||||||
(#set! injection.language "regex"))
|
(#set! injection.language "regex"))
|
||||||
(navigation_suffix
|
(navigation_suffix
|
||||||
((simple_identifier) @_function
|
((simple_identifier) @_function
|
||||||
|
|
@ -21,7 +22,8 @@
|
||||||
(call_suffix
|
(call_suffix
|
||||||
(value_arguments
|
(value_arguments
|
||||||
(value_argument
|
(value_argument
|
||||||
(string_literal) @injection.content
|
(string_literal
|
||||||
|
(string_content) @injection.content)
|
||||||
(#set! injection.language "regex")))))
|
(#set! injection.language "regex")))))
|
||||||
|
|
||||||
; - Regex.fromLiteral("[abc]?")
|
; - Regex.fromLiteral("[abc]?")
|
||||||
|
|
@ -35,13 +37,15 @@
|
||||||
(call_suffix
|
(call_suffix
|
||||||
(value_arguments
|
(value_arguments
|
||||||
(value_argument
|
(value_argument
|
||||||
(string_literal) @injection.content
|
(string_literal
|
||||||
|
(string_content) @injection.content)
|
||||||
(#set! injection.language "regex")))))
|
(#set! injection.language "regex")))))
|
||||||
|
|
||||||
; "pi = %.2f".format(3.14159)
|
; "pi = %.2f".format(3.14159)
|
||||||
((call_expression
|
((call_expression
|
||||||
(navigation_expression
|
(navigation_expression
|
||||||
(string_literal) @injection.content
|
(string_literal
|
||||||
|
(string_content) @injection.content)
|
||||||
(navigation_suffix
|
(navigation_suffix
|
||||||
(simple_identifier) @_method)))
|
(simple_identifier) @_method)))
|
||||||
(#eq? @_method "format")
|
(#eq? @_method "format")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue