mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-15 09:50:04 -04:00
ci: don't skip swift anymore
I think this was a nvim 0.6 issue
This commit is contained in:
parent
5633f897a7
commit
901b31f66c
2 changed files with 22 additions and 28 deletions
2
.github/workflows/test-queries.yml
vendored
2
.github/workflows/test-queries.yml
vendored
|
|
@ -87,6 +87,4 @@ jobs:
|
||||||
run: echo "SKIP_SWIFT_CHECK=TRUE" >> $GITHUB_ENV
|
run: echo "SKIP_SWIFT_CHECK=TRUE" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Check query files
|
- name: Check query files
|
||||||
env:
|
|
||||||
SKIP_SWIFT_CHECK: ${{ env.SKIP_SWIFT_CHECK }}
|
|
||||||
run: $NVIM --headless -c "luafile ./scripts/check-queries.lua" -c "q"
|
run: $NVIM --headless -c "luafile ./scripts/check-queries.lua" -c "q"
|
||||||
|
|
|
||||||
|
|
@ -47,32 +47,28 @@ local function do_check()
|
||||||
io_print "::group::Check parsers"
|
io_print "::group::Check parsers"
|
||||||
|
|
||||||
for _, lang in pairs(parsers) do
|
for _, lang in pairs(parsers) do
|
||||||
-- NOTE: this is a temporary workaround to skip swift tests on ubuntu
|
timings[lang] = {}
|
||||||
-- stable and should be removed once neovim 0.7 is released.
|
for _, query_type in pairs(query_types) do
|
||||||
if vim.fn.getenv "SKIP_SWIFT_CHECK" == vim.NIL or lang ~= "swift" then
|
local before = vim.loop.hrtime()
|
||||||
timings[lang] = {}
|
local ok, query = pcall(queries.get_query, lang, query_type)
|
||||||
for _, query_type in pairs(query_types) do
|
local after = vim.loop.hrtime()
|
||||||
local before = vim.loop.hrtime()
|
local duration = after - before
|
||||||
local ok, query = pcall(queries.get_query, lang, query_type)
|
table.insert(timings, { duration = duration, lang = lang, query_type = query_type })
|
||||||
local after = vim.loop.hrtime()
|
io_print("Checking " .. lang .. " " .. query_type .. string.format(" (%.02fms)", duration * 1e-6))
|
||||||
local duration = after - before
|
if not ok then
|
||||||
table.insert(timings, { duration = duration, lang = lang, query_type = query_type })
|
vim.api.nvim_err_writeln(query)
|
||||||
io_print("Checking " .. lang .. " " .. query_type .. string.format(" (%.02fms)", duration * 1e-6))
|
last_error = query
|
||||||
if not ok then
|
else
|
||||||
vim.api.nvim_err_writeln(query)
|
if query then
|
||||||
last_error = query
|
for _, capture in ipairs(query.captures) do
|
||||||
else
|
local is_valid = (
|
||||||
if query then
|
vim.startswith(capture, "_") -- Helpers.
|
||||||
for _, capture in ipairs(query.captures) do
|
or vim.tbl_contains(captures[query_type], capture)
|
||||||
local is_valid = (
|
)
|
||||||
vim.startswith(capture, "_") -- Helpers.
|
if not is_valid then
|
||||||
or vim.tbl_contains(captures[query_type], capture)
|
local error = string.format("(x) Invalid capture @%s in %s for %s.", capture, query_type, lang)
|
||||||
)
|
io_print(error)
|
||||||
if not is_valid then
|
last_error = error
|
||||||
local error = string.format("(x) Invalid capture @%s in %s for %s.", capture, query_type, lang)
|
|
||||||
io_print(error)
|
|
||||||
last_error = error
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue