mirror of
https://github.com/neovim/neovim.git
synced 2026-08-29 18:41:48 +00:00
fix(lsp): handle self-mapped methods in supports_method #39383
Problem:
The LSP client incorrectly checks for server capabilities when determining
support for self-mapped methods (e.g., 'shutdown'), which do not have
corresponding capabilities in the server's response. This leads to false
negatives when checking if such methods are supported.
This was handled correctly for dynamic registrations, but not for static.
Methods such as 'shutdown', do not have a related server capability and should
be assumed to be supported.
Solution:
Update the `supports_method` logic to always return true for self-mapped
methods.
(cherry picked from commit f83d0b9653)
This commit is contained in:
committed by
github-actions[bot]
parent
e5d6d2e769
commit
aedbae4ab6
@@ -998,6 +998,10 @@ describe('LSP', function()
|
||||
eq(true, client:supports_method('textDocument/hover'))
|
||||
eq(false, client:supports_method('textDocument/definition'))
|
||||
|
||||
-- Self-mapped methods do not have a related server capability and should be assumed
|
||||
-- to be supported.
|
||||
eq(true, client:supports_method('shutdown'))
|
||||
|
||||
-- unknown methods are assumed to be supported.
|
||||
eq(true, client:supports_method('unknown-method'))
|
||||
end,
|
||||
|
||||
Reference in New Issue
Block a user