From ad745f9da289a56035b8c759cc8fac1b40a44558 Mon Sep 17 00:00:00 2001 From: Alvaro Muñoz Date: Wed, 26 Feb 2020 20:22:14 +0100 Subject: add support to show diagnostics count in statusline (#11641) * add support to show diagnostics count in statusline * documentation --- runtime/lua/vim/lsp.lua | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'runtime/lua/vim/lsp.lua') 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. -- cgit