mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 11:06:54 -04:00
fix(check-queries): only show timings for existing queries
This commit is contained in:
parent
fa0bb30ebd
commit
01dd4b05cf
1 changed files with 4 additions and 2 deletions
|
|
@ -19,8 +19,10 @@ do
|
|||
local before = vim.uv.hrtime()
|
||||
local ok, query = pcall(vim.treesitter.query.get, lang, query_type)
|
||||
local duration = vim.uv.hrtime() - before
|
||||
table.insert(timings, { duration = duration, lang = lang, query_type = query_type })
|
||||
print(string.format('Checking %s %s (%.02fms)', lang, query_type, duration * 1e-6))
|
||||
if query then
|
||||
table.insert(timings, { duration = duration, lang = lang, query_type = query_type })
|
||||
print(string.format('Checking %s %s (%.02fms)', lang, query_type, duration * 1e-6))
|
||||
end
|
||||
if not ok then
|
||||
errors[#errors + 1] = string.format('%s (%s): %s', lang, query_type, query)
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue