mirror of
				https://github.com/neovim/neovim.git
				synced 2025-10-26 12:27:24 +00:00 
			
		
		
		
	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.
			
			
This commit is contained in:
		| @@ -566,7 +566,7 @@ buf_notify({bufnr}, {method}, {params})                 *vim.lsp.buf_notify()* | |||||||
|     Parameters: ~ |     Parameters: ~ | ||||||
|       • {bufnr}   (number|nil) The number of the buffer |       • {bufnr}   (number|nil) The number of the buffer | ||||||
|       • {method}  (string) Name of the request method |       • {method}  (string) Name of the request method | ||||||
|       • {params}  (string) Arguments to send to the server |       • {params}  (any) Arguments to send to the server | ||||||
|  |  | ||||||
|     Return: ~ |     Return: ~ | ||||||
|         true if any client returns true; false otherwise |         true if any client returns true; false otherwise | ||||||
|   | |||||||
| @@ -2048,7 +2048,7 @@ end | |||||||
| --- Send a notification to a server | --- Send a notification to a server | ||||||
| ---@param bufnr (number|nil) The number of the buffer | ---@param bufnr (number|nil) The number of the buffer | ||||||
| ---@param method (string) Name of the request method | ---@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 | ---@returns true if any client returns true; false otherwise | ||||||
| function lsp.buf_notify(bufnr, method, params) | function lsp.buf_notify(bufnr, method, params) | ||||||
|   | |||||||
| @@ -293,7 +293,7 @@ end | |||||||
| ---@private | ---@private | ||||||
| --- Sends a notification to the LSP server. | --- Sends a notification to the LSP server. | ||||||
| ---@param method (string) The invoked LSP method | ---@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 | ---@returns (bool) `true` if notification could be sent, `false` if not | ||||||
| function Client:notify(method, params) | function Client:notify(method, params) | ||||||
|   return self:encode_and_send({ |   return self:encode_and_send({ | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Chris Kipp
					Chris Kipp