aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/lsp.lua
diff options
context:
space:
mode:
authorAlvaro Muñoz <alvaro@pwntester.com>2020-02-26 20:22:14 +0100
committerGitHub <noreply@github.com>2020-02-26 20:22:14 +0100
commitad745f9da289a56035b8c759cc8fac1b40a44558 (patch)
treed7ccdb603c4665fed5ed627de4cfeb714b1000c1 /runtime/lua/vim/lsp.lua
parentca8699378c765017575c102f3da8347833159a6c (diff)
downloadrneovim-ad745f9da289a56035b8c759cc8fac1b40a44558.tar.gz
rneovim-ad745f9da289a56035b8c759cc8fac1b40a44558.tar.bz2
rneovim-ad745f9da289a56035b8c759cc8fac1b40a44558.zip
add support to show diagnostics count in statusline (#11641)
* add support to show diagnostics count in statusline * documentation
Diffstat (limited to 'runtime/lua/vim/lsp.lua')
-rw-r--r--runtime/lua/vim/lsp.lua17
1 files changed, 9 insertions, 8 deletions
diff --git a/runtime/lua/vim/lsp.lua b/runtime/lua/vim/lsp.lua
index bc0da25ae5..71ec3cb6c4 100644
--- a/runtime/lua/vim/lsp.lua
+++ b/runtime/lua/vim/lsp.lua
@@ -893,21 +893,22 @@ function lsp.buf_request_sync(bufnr, method, params, timeout_ms)
return request_results
end
---- Sends a notification to all servers attached to the buffer.
----
---@param bufnr (optional, number) Buffer handle, or 0 for current
---@param method (string) LSP method name
---@param params (string) Parameters to send to the server
----
---@returns nil
+--- Send a notification to a server
+-- @param bufnr [number] (optional): The number of the buffer
+-- @param method [string]: Name of the request method
+-- @param params [string]: Arguments to send to the server
+--
+-- @returns true if any client returns true; false otherwise
function lsp.buf_notify(bufnr, method, params)
validate {
bufnr = { bufnr, 'n', true };
method = { method, 's' };
}
+ local resp = false
for_each_buffer_client(bufnr, function(client, _client_id)
- client.rpc.notify(method, params)
+ if client.rpc.notify(method, params) then resp = true end
end)
+ return resp
end
--- Implements 'omnifunc' compatible LSP completion.