Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lua/noice/lsp/message.lua
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ M.message_type = {
---@alias ShowMessageParams {type:MessageType, message:string}

function M.setup()
vim.lsp.handlers["window/showMessage"] = M._on_message
vim.lsp.handlers["window/showMessage"] = M.on_message
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was looking though git blame. You might want to use Util.protect(M.on_message) to restore the previous behavior.

See 0f5f8c93

Suggested change
vim.lsp.handlers["window/showMessage"] = M.on_message
vim.lsp.handlers["window/showMessage"] = Util.protect(M.on_message)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks reasonable, but I'm not sure, since @folke explicitly removed the Util.protect call in the same commit changing M.on_message to M._on_message. Might be a typo, though.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding the Util.protect call gives me the following error upon LazyVim startup:

   Error  09:35:36 AM notify.error noice.nvim `vim.lsp.handlers["window/showMessage"]` has been overwritten by another plugin?

Either disable the other plugin or set `config.lsp.message.enabled = false` in your **Noice** config.
  - plugin: noice.nvim
  - file: /home/lian/.local/share/nvim/lazy/noice.nvim/lua/noice/util/call.lua
  - line: 51

end

---@param result ShowMessageParams
Expand Down