mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-21 21:00:08 -04:00
fix(python): improve f-string injections (#8644)
Problem: Neovim removed match limits, which can lead to catastrophic performance with injection queries. Solution: Tighten up f-string injections.
This commit is contained in:
parent
2497714755
commit
7248feaca4
2 changed files with 23 additions and 6 deletions
|
|
@ -3,7 +3,12 @@
|
|||
object: (identifier) @_re)
|
||||
arguments: (argument_list
|
||||
(string
|
||||
(string_content) @injection.content))
|
||||
(string_start)
|
||||
[
|
||||
(string_content) @injection.content
|
||||
(interpolation)
|
||||
]+
|
||||
(string_end)))
|
||||
(#eq? @_re "re")
|
||||
(#set! injection.language "regex"))
|
||||
|
||||
|
|
@ -12,11 +17,13 @@
|
|||
object: (identifier) @_re)
|
||||
arguments: (argument_list
|
||||
(concatenated_string
|
||||
[
|
||||
(string
|
||||
(string_content) @injection.content)
|
||||
(comment)
|
||||
]+))
|
||||
(string
|
||||
(string_start)
|
||||
[
|
||||
(string_content) @injection.content
|
||||
(interpolation)
|
||||
]+
|
||||
(string_end))))
|
||||
(#eq? @_re "re")
|
||||
(#set! injection.language "regex"))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue