aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorToby Vincent <tobyv@tobyvin.dev>2024-07-26 15:15:24 -0500
committerToby Vincent <tobyv@tobyvin.dev>2024-07-26 15:15:24 -0500
commit0de796acbf85d73c89fedfd35adaf254a15dfcc0 (patch)
treed2feae4f502e52264cc96e54a3f9f244a078fab9
parent25d48271e3d4404ba017cb92a37d3a681c1ad149 (diff)
fix(injected): handle error when no treesitter parser foundfix_injected
-rw-r--r--lua/conform/formatters/injected.lua3
1 files changed, 2 insertions, 1 deletions
diff --git a/lua/conform/formatters/injected.lua b/lua/conform/formatters/injected.lua
index bd3313b..655acbc 100644
--- a/lua/conform/formatters/injected.lua
+++ b/lua/conform/formatters/injected.lua
@@ -148,7 +148,8 @@ return {
local buf_lang = vim.treesitter.language.get_lang(vim.bo[ctx.buf].filetype)
local ok, parser = pcall(vim.treesitter.get_string_parser, text, buf_lang)
if not ok then
- callback("No treesitter parser for buffer")
+ log.trace("No treesitter parser found for language: %s", buf_lang)
+ callback(nil, nil)
return
end
---@type conform.InjectedFormatterOptions