fix(ts): include exit code and stdout fallback in build/generate logs

This commit is contained in:
2026-05-03 10:15:21 +02:00
parent 6703b8acba
commit 9b22a86042
+12 -4
View File
@@ -66,10 +66,14 @@ function M.build(repo, parser)
local function on_build(r)
if r.code ~= 0 then
local detail = r.stderr ~= "" and r.stderr
or r.stdout ~= "" and r.stdout
or "(no output)"
log.error(
"Failed to build parser for %s: %s",
"Failed to build parser for %s (exit %d): %s",
parser.lang,
r.stderr or ""
r.code,
detail
)
return
end
@@ -103,10 +107,14 @@ function M.build(repo, parser)
},
vim.schedule_wrap(function(r)
if r.code ~= 0 then
local detail = r.stderr ~= "" and r.stderr
or r.stdout ~= "" and r.stdout
or "(no output)"
log.error(
"Failed to generate parser for %s: %s",
"Failed to generate parser for %s (exit %d): %s",
parser.lang,
r.stderr or ""
r.code,
detail
)
return
end