- Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdebugging.lua
More file actions
Latest commit
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
localfunctioncheck_treesitter_queries()
-- Get all languages from the language table (works in 0.12)
locallanguages= {}
forlang, _inpairs(vim.treesitter.language) do
table.insert(languages, lang)
end
if#languages==0then
print("No TreeSitter languages found.")
return
end
localbroken_count=0
for_, langinipairs(languages) do
localok, err=pcall(function()
vim.treesitter.query.get(lang, "highlights")
end)
ifnotokthen
print("BROKEN: " ..lang.." → " ..tostring(err))
broken_count=broken_count+1
end
end
ifbroken_count==0then
print("All TreeSitter queries loaded successfully!")
else
print("Total broken parsers: " ..broken_count)
end
end
-- Run it
check_treesitter_queries()