Conversation
Replace typo _on_message with on_message in the LSP message handler.
|
This PR is stale because it has been open 30 days with no activity. |
|
Not stale |
|
This PR is stale because it has been open 30 days with no activity. |
|
Still pending |
|
this is actually pretty helpful! |
|
This PR is stale because it has been open 30 days with no activity. |
|
No |
|
I've also run into this bug. This PR seems to fix this error. |
|
|
||
| function M.setup() | ||
| vim.lsp.handlers["window/showMessage"] = M._on_message | ||
| vim.lsp.handlers["window/showMessage"] = M.on_message |
There was a problem hiding this comment.
I was looking though git blame. You might want to use Util.protect(M.on_message) to restore the previous behavior.
See 0f5f8c93
| vim.lsp.handlers["window/showMessage"] = M.on_message | |
| vim.lsp.handlers["window/showMessage"] = Util.protect(M.on_message) |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
|
Hit the same issue and same fix while debugging my own language server using LazyVim. |
|
A non-intrusive workaround: #1074 (comment) |
Fixes typo where M._on_message (undefined) was assigned as the LSP handler instead of M.on_message. LSP window/showMessage was silently broken. From upstream PR folke/noice.nvim#1103 Co-Authored-By: tris203 <tris203@users.noreply.github.com>
Replace typo _on_message with on_message in the LSP message handler.
Description
Related Issue(s)
Closes #1074
Screenshots