fix(lsp): do not assume client capability exists in watchfiles check (#24558)

Backports #24550.

Adjusts test to expect that didChangeWatchedFiles is *not* registered if
client `capabilities` is nil (as it's not enabled by default for v0.9).
This commit is contained in:
Sean Dewar
2023-08-04 10:16:54 +01:00
committed by GitHub
parent 5e6c8b3385
commit df63474930
4 changed files with 71 additions and 49 deletions

View File

@@ -933,8 +933,7 @@ end
--- |vim.lsp.protocol.make_client_capabilities()|, passed to the language
--- server on initialization. Hint: use make_client_capabilities() and modify
--- its result.
--- - Note: To send an empty dictionary use
--- `{[vim.type_idx]=vim.types.dictionary}`, else it will be encoded as an
--- - Note: To send an empty dictionary use |vim.empty_dict()|, else it will be encoded as an
--- array.
---
--- - handlers: Map of language server method names to |lsp-handler|