diff options
author | Toby Vincent <tobyv@tobyvin.dev> | 2024-07-26 15:15:24 -0500 |
---|---|---|
committer | Toby Vincent <tobyv@tobyvin.dev> | 2024-07-26 15:15:24 -0500 |
commit | 0de796acbf85d73c89fedfd35adaf254a15dfcc0 (patch) | |
tree | d2feae4f502e52264cc96e54a3f9f244a078fab9 /lua/conform/formatters/injected.lua | |
parent | 25d48271e3d4404ba017cb92a37d3a681c1ad149 (diff) |
fix(injected): handle error when no treesitter parser foundfix_injected
Diffstat (limited to 'lua/conform/formatters/injected.lua')
-rw-r--r-- | lua/conform/formatters/injected.lua | 3 |
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 |