bugfix null_ls go test

pull/324/head
ray-x 1 year ago
parent 636fe41c87
commit 1be8ef7cdf

@ -90,13 +90,13 @@ local function handler()
line = lnum line = lnum
end end
-- log(found, filename, lnum)
if found == true then if found == true then
local pkg_path = require('go.gotest').get_test_path() .. utils.sep() local pkg_path = require('go.gotest').get_test_path() .. utils.sep()
output = pkg_path .. utils.ltrim(entry.Output) output = pkg_path .. utils.ltrim(entry.Output)
else -- not found or format is correct else -- not found or format is correct
output = output .. (entry.Output or '') output = output .. (entry.Output or '')
end end
log(found, filename, lnum)
if entry.Output:find('FAIL') or entry.Output:find('panic') then if entry.Output:find('FAIL') or entry.Output:find('panic') then
table.insert(panic, entry.Output) table.insert(panic, entry.Output)
end end
@ -155,7 +155,7 @@ local function handler()
if #diags > 0 or test_failed then if #diags > 0 or test_failed then
vim.schedule(function() vim.schedule(function()
vim.notify('go test failed: ' .. '\n please check quickfix!\n', vim.log.levels.WARN) vim.notify('go test failed: ' .. '\n please check quickfix!\n', vim.log.levels.WARN)
end)() end)
end end
-- local ok, d = pcall(vfn.json_decode, msg) -- local ok, d = pcall(vfn.json_decode, msg)
return done(diags) return done(diags)

Loading…
Cancel
Save