mirror of
https://github.com/neovim/neovim
synced 2025-07-16 01:01:49 +00:00
feat(treesitter): show which nodes are missing in InspectTree
Now `:InspectTree` will show missing nodes as e.g. `(MISSING identifier)` or `(MISSING ";")` rather than just `(identifier)` or `";"`. This is doable because the `MISSING` keyword is now valid query syntax. Co-authored-by: Christian Clason <c.clason@uni-graz.at>
This commit is contained in:
committed by
Christian Clason
parent
d769c340b9
commit
09f9f0a946
@ -224,9 +224,12 @@ function TSTreeView:draw(bufnr)
|
||||
|
||||
local text ---@type string
|
||||
if item.node:named() then
|
||||
text = string.format('(%s', item.node:type())
|
||||
text = string.format('(%s%s', item.node:missing() and 'MISSING ' or '', item.node:type())
|
||||
else
|
||||
text = string.format('%q', item.node:type()):gsub('\n', 'n')
|
||||
if item.node:missing() then
|
||||
text = string.format('(MISSING %s)', text)
|
||||
end
|
||||
end
|
||||
if item.field then
|
||||
text = string.format('%s: %s', item.field, text)
|
||||
|
Reference in New Issue
Block a user