Skip to content

Commit

Permalink
fix: unify timeout error message format with LSP
Browse files Browse the repository at this point in the history
  • Loading branch information
stevearc committed Sep 17, 2023
1 parent a589750 commit 0d963f8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion doc/recipes.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ require("conform").setup({
return
end
local function on_format(err)
if err and err:match("timed out$") then
if err and err:match("timeout$") then
slow_format_filetypes[vim.bo[bufnr].filetype] = true
end
end
Expand Down
4 changes: 2 additions & 2 deletions lua/conform/runner.lua
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ M.format_sync = function(bufnr, formatters, timeout_ms, range)
if remaining <= 0 then
return {
code = M.ERROR_CODE.TIMEOUT,
message = string.format("Formatter '%s' timed out", formatter.name),
message = string.format("Formatter '%s' timeout", formatter.name),
}
end
local done = false
Expand All @@ -539,7 +539,7 @@ M.format_sync = function(bufnr, formatters, timeout_ms, range)
if wait_reason == -1 then
return {
code = M.ERROR_CODE.TIMEOUT,
message = string.format("Formatter '%s' timed out", formatter.name),
message = string.format("Formatter '%s' timeout", formatter.name),
}
else
return {
Expand Down

0 comments on commit 0d963f8

Please sign in to comment.