Skip to content

Commit

Permalink
fix: remove redundant notification.
Browse files Browse the repository at this point in the history
  • Loading branch information
ayamir committed Jun 30, 2024
1 parent 34f7946 commit e78265b
Showing 1 changed file with 8 additions and 16 deletions.
24 changes: 8 additions & 16 deletions lua/modules/configs/completion/formatting.lua
Original file line number Diff line number Diff line change
Expand Up @@ -160,24 +160,16 @@ function M.format(opts)
end

if format_modifications_only then
if client.server_capabilities.documentRangeFormattingProvider then
if
format_notify
and require("lsp-format-modifications").format_modifications(client, bufnr).success
then
vim.notify(
string.format("[LSP] Format changed lines successfully with %s!", client.name),
vim.log.levels.INFO,
{ title = "LSP Range Format Success" }
)
return
end
else
if
format_notify
and require("lsp-format-modifications").format_modifications(client, bufnr).success
then
vim.notify(
string.format("[LSP] Modification only formatting is not supported by formatter [%s]!", client.name),
vim.log.levels.WARN,
{ title = "LSP Range Format Warning" }
string.format("[LSP] Format changed lines successfully with %s!", client.name),
vim.log.levels.INFO,
{ title = "LSP Range Format Success" }
)
return
end
end

Expand Down

0 comments on commit e78265b

Please sign in to comment.