diff --git a/lua/ts.lua b/lua/ts.lua index 7812378..fd02180 100644 --- a/lua/ts.lua +++ b/lua/ts.lua @@ -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