From 01dd4b05cf83bf3e4aaac7133a227de7226c1d1e Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Fri, 30 May 2025 15:55:30 +0200 Subject: fix(check-queries): only show timings for existing queries --- scripts/check-queries.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/check-queries.lua b/scripts/check-queries.lua index 796e3f5fc..d951cf2d6 100755 --- a/scripts/check-queries.lua +++ b/scripts/check-queries.lua @@ -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 -- cgit v1.2.3-70-g09d2