mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-06 05:20:00 -04:00
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>
This commit is contained in:
parent
3da5cfb4a2
commit
1610b1aafb
2 changed files with 10 additions and 3 deletions
|
|
@ -346,3 +346,11 @@
|
|||
;; https://docs.python.org/3/library/stdtypes.html
|
||||
"bool" "int" "float" "complex" "list" "tuple" "range" "str"
|
||||
"bytes" "bytearray" "memoryview" "set" "frozenset" "dict" "type" "object"))
|
||||
|
||||
;; Regex from the `re` module
|
||||
|
||||
(call
|
||||
function: (attribute
|
||||
object: (identifier) @_re)
|
||||
arguments: (argument_list . (string (string_content) @string.regex))
|
||||
(#eq? @_re "re"))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue