Skip to content

Commit a2db417

Browse files
committed
notify before using LSP as fallback formatter
I want to know about the configured formatter failing, because the LSP's formatting behavior might be different, and I might not notice the difference. I've also added a comment to illustrate what other options are possible, such as turning off the fallback entirely with `false`. I'll leave the fallback up for now because at least I'm getting notifications! This was motivated by initially being confused about whether `mix` was trimming trailing whitespace or not. Turns out it *was* trimming trailing whitespace, just not for comments.
1 parent 2a953bb commit a2db417

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lua/plugins/conform.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ return { -- Autoformat
1313
},
1414
},
1515
opts = {
16-
notify_on_error = false,
16+
notify_on_error = true,
1717
format_on_save = function(bufnr)
1818
-- Disable "format_on_save lsp_fallback" for languages that don't
1919
-- have a well standardized coding style. You can add additional
@@ -24,7 +24,7 @@ return { -- Autoformat
2424
else
2525
return {
2626
timeout_ms = 500,
27-
lsp_format = 'fallback',
27+
lsp_format = 'fallback', -- or false
2828
}
2929
end
3030
end,

0 commit comments

Comments
 (0)