mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
fix(formatter): adapt formatter for nightly
After Neovim pull #30193, the formatter was broken due to changes in the way node data is passed to predicates.
This commit is contained in:
parent
00f128dd73
commit
58030e6d6f
1 changed files with 4 additions and 2 deletions
|
|
@ -14,7 +14,8 @@ else
|
||||||
end
|
end
|
||||||
|
|
||||||
ts.query.add_predicate("kind-eq?", function(match, _, _, pred)
|
ts.query.add_predicate("kind-eq?", function(match, _, _, pred)
|
||||||
local node = match[pred[2]]
|
local cap = match[pred[2]]
|
||||||
|
local node = type(cap) == "table" and cap[1] or cap
|
||||||
if not node then
|
if not node then
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
@ -24,7 +25,8 @@ ts.query.add_predicate("kind-eq?", function(match, _, _, pred)
|
||||||
end, true)
|
end, true)
|
||||||
|
|
||||||
ts.query.add_predicate("is-start-of-line?", function(match, _, _, pred)
|
ts.query.add_predicate("is-start-of-line?", function(match, _, _, pred)
|
||||||
local node = match[pred[2]]
|
local cap = match[pred[2]]
|
||||||
|
local node = type(cap) == "table" and cap[1] or cap
|
||||||
if not node then
|
if not node then
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue