aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Kipp <ckipp@pm.me>2023-01-11 20:17:10 +0100
committerGitHub <noreply@github.com>2023-01-11 20:17:10 +0100
commita37c686d21c1ad4e50f455e989642d38435d41ba (patch)
treee02839edbad36027acda29a23e5a0685e88efb2b
parent8c5c2136fef12e6fe00739c91ff994344ab5d466 (diff)
downloadrneovim-a37c686d21c1ad4e50f455e989642d38435d41ba.tar.gz
rneovim-a37c686d21c1ad4e50f455e989642d38435d41ba.tar.bz2
rneovim-a37c686d21c1ad4e50f455e989642d38435d41ba.zip
docs(lsp): update buf_notify and rpc.notify params types (#21753)
Small, but I was getting warnings about my usage of `vim.lsp.buf_notify(bufnr, method, {example = example})` since the docs say that `params` must be a string, however this can really be anything when it's passed to `rpc.notify` since we just end up calling `vim.json.encode(payload)` on it. This fixes the docs in those two places and regenerates them.
-rw-r--r--runtime/doc/lsp.txt2
-rw-r--r--runtime/lua/vim/lsp.lua2
-rw-r--r--runtime/lua/vim/lsp/rpc.lua2
3 files changed, 3 insertions, 3 deletions
diff --git a/runtime/doc/lsp.txt b/runtime/doc/lsp.txt
index aff0f9a793..703c0b9d03 100644
--- a/runtime/doc/lsp.txt
+++ b/runtime/doc/lsp.txt
@@ -566,7 +566,7 @@ buf_notify({bufnr}, {method}, {params}) *vim.lsp.buf_notify()*
Parameters: ~
• {bufnr} (number|nil) The number of the buffer
• {method} (string) Name of the request method
- • {params} (string) Arguments to send to the server
+ • {params} (any) Arguments to send to the server
Return: ~
true if any client returns true; false otherwise
diff --git a/runtime/lua/vim/lsp.lua b/runtime/lua/vim/lsp.lua
index 13f8c81dfb..cfd6c938f7 100644
--- a/runtime/lua/vim/lsp.lua
+++ b/runtime/lua/vim/lsp.lua
@@ -2048,7 +2048,7 @@ end
--- Send a notification to a server
---@param bufnr (number|nil) The number of the buffer
---@param method (string) Name of the request method
----@param params (string) Arguments to send to the server
+---@param params (any) Arguments to send to the server
---
---@returns true if any client returns true; false otherwise
function lsp.buf_notify(bufnr, method, params)
diff --git a/runtime/lua/vim/lsp/rpc.lua b/runtime/lua/vim/lsp/rpc.lua
index b93b227150..f1492601ff 100644
--- a/runtime/lua/vim/lsp/rpc.lua
+++ b/runtime/lua/vim/lsp/rpc.lua
@@ -293,7 +293,7 @@ end
---@private
--- Sends a notification to the LSP server.
---@param method (string) The invoked LSP method
----@param params (table|nil): Parameters for the invoked LSP method
+---@param params (any): Parameters for the invoked LSP method
---@returns (bool) `true` if notification could be sent, `false` if not
function Client:notify(method, params)
return self:encode_and_send({