From 9b22a860426e61a6bf458121a7ed2915f8455821 Mon Sep 17 00:00:00 2001 From: Oscar Wallberg Date: Sun, 3 May 2026 10:15:21 +0200 Subject: [PATCH] fix(ts): include exit code and stdout fallback in build/generate logs --- lua/ts.lua | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) 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