nvim-treesitter/queries/python/injections.scm
Riley Bruins 1610b1aafb
feat(python): @string.regex capture, injection improvements (#5697)
* feat(python): `@string.regex` capture, injection improvements

* fix(python): match regex only for first argument of re module

* chore(python): remove unneeded capture

Co-authored-by: Santos Gallegos <stsewd@proton.me>

* fix(python): only highlight string content itself as regex

---------

Co-authored-by: Santos Gallegos <stsewd@proton.me>
2023-11-21 01:26:18 +09:00

10 lines
303 B
Scheme

(call
function: (attribute
object: (identifier) @_re)
arguments: (argument_list . (string
(string_content) @injection.content))
(#eq? @_re "re")
(#set! injection.language "regex"))
((comment) @injection.content
(#set! injection.language "comment"))