-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdebugging.lua
More file actions
37 lines (30 loc) · 866 Bytes
/
Copy pathdebugging.lua
File metadata and controls
37 lines (30 loc) · 866 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
-- debugging.lua
-- Check which TreeSitter parsers have broken queries
local function check_treesitter_queries()
-- Get all languages from the language table (works in 0.12)
local languages = {}
for lang, _ in pairs(vim.treesitter.language) do
table.insert(languages, lang)
end
if #languages == 0 then
print("No TreeSitter languages found.")
return
end
local broken_count = 0
for _, lang in ipairs(languages) do
local ok, err = pcall(function()
vim.treesitter.query.get(lang, "highlights")
end)
if not ok then
print("BROKEN: " .. lang .. " → " .. tostring(err))
broken_count = broken_count + 1
end
end
if broken_count == 0 then
print("All TreeSitter queries loaded successfully!")
else
print("Total broken parsers: " .. broken_count)
end
end
-- Run it
check_treesitter_queries()