aboutsummaryrefslogtreecommitdiff
path: root/runtime
diff options
context:
space:
mode:
Diffstat (limited to 'runtime')
-rw-r--r--runtime/doc/news.txt1
-rw-r--r--runtime/lua/vim/treesitter/dev.lua5
2 files changed, 5 insertions, 1 deletions
diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt
index 4e573197b7..fda37852d6 100644
--- a/runtime/doc/news.txt
+++ b/runtime/doc/news.txt
@@ -381,6 +381,7 @@ TREESITTER
queries in addition to overriding.
• |LanguageTree:is_valid()| now accepts a range parameter to narrow the scope
of the validity check.
+• |:InspectTree| now shows which nodes are missing.
TUI
diff --git a/runtime/lua/vim/treesitter/dev.lua b/runtime/lua/vim/treesitter/dev.lua
index ab08e1a527..24dd8243db 100644
--- a/runtime/lua/vim/treesitter/dev.lua
+++ b/runtime/lua/vim/treesitter/dev.lua
@@ -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)