mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 11:06:54 -04:00
fix(formatter): increase match limit
Problem: Some very long patterns were not formatted correctly. Solution: Increase the match limit when iterating to 1024.
This commit is contained in:
parent
6fe0032640
commit
12e0246e4f
5 changed files with 55 additions and 54 deletions
|
|
@ -446,7 +446,7 @@ local function format(bufnr, queries)
|
|||
}
|
||||
local root = ts.get_parser(bufnr, 'query'):parse(true)[1]:root()
|
||||
local query = ts.query.parse('query', queries)
|
||||
for id, node, metadata in query:iter_captures(root, bufnr) do
|
||||
for id, node, metadata in query:iter_captures(root, bufnr, nil, nil, { match_limit = 1024 }) do
|
||||
if query.captures[id]:sub(1, 1) ~= '_' then
|
||||
map[query.captures[id]][node:id()] = metadata and (metadata[id] and metadata[id] or metadata)
|
||||
or {}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue