aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/lsp.lua
diff options
context:
space:
mode:
authorChris AtLee <chris.atlee@shopify.com>2023-08-31 04:00:24 -0400
committerGitHub <noreply@github.com>2023-08-31 10:00:24 +0200
commitc235959fd909d75248c066a781475e207606c5aa (patch)
tree340f439aa9c6cc533cc33e14439acc473662c35e /runtime/lua/vim/lsp.lua
parentee56daebb6468075e743db0d605cb3f2a1699419 (diff)
downloadrneovim-c235959fd909d75248c066a781475e207606c5aa.tar.gz
rneovim-c235959fd909d75248c066a781475e207606c5aa.tar.bz2
rneovim-c235959fd909d75248c066a781475e207606c5aa.zip
fix(lsp): only disable inlay hints / diagnostics if no other clients are connected (#24535)
This fixes the issue where the LspNotify handlers for inlay_hint / diagnostics would end up refreshing all attached clients. The handler would call util._refresh, which called vim.lsp.buf_request, which calls the method on all attached clients. Now util._refresh takes an optional client_id parameter, which is used to specify a specific client to update. This commit also fixes util._refresh's handling of the `only_visible` flag. Previously if `only_visible` was false, two requests would be made to the server: one for the visible region, and one for the entire file. Co-authored-by: Stanislav Asunkin <1353637+stasjok@users.noreply.github.com> Co-authored-by: Mathias Fußenegger <mfussenegger@users.noreply.github.com>
Diffstat (limited to 'runtime/lua/vim/lsp.lua')
-rw-r--r--runtime/lua/vim/lsp.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/runtime/lua/vim/lsp.lua b/runtime/lua/vim/lsp.lua
index 2a16bafbfc..1990c09561 100644
--- a/runtime/lua/vim/lsp.lua
+++ b/runtime/lua/vim/lsp.lua
@@ -2118,7 +2118,7 @@ api.nvim_create_autocmd('VimLeavePre', {
---@param bufnr (integer) Buffer handle, or 0 for current.
---@param method (string) LSP method name
---@param params table|nil Parameters to send to the server
----@param handler lsp-handler See |lsp-handler|
+---@param handler? lsp-handler See |lsp-handler|
--- If nil, follows resolution strategy defined in |lsp-handler-configuration|
---
---@return table<integer, integer> client_request_ids Map of client-id:request-id pairs