aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/lsp/handlers.lua
diff options
context:
space:
mode:
authorMathias Fussenegger <f.mathias@zignar.net>2024-10-08 19:04:28 +0200
committerMathias Fußenegger <mfussenegger@users.noreply.github.com>2024-10-20 14:43:22 +0200
commitdff684fdb3d2e787ac6d6fd49ec52ede604fd0ce (patch)
tree01bde7b45b183b771f1bfae5b436584cf95cc4b6 /runtime/lua/vim/lsp/handlers.lua
parentce9a9b4700262fb50312720bfdffbebfc7d8ef7a (diff)
downloadrneovim-dff684fdb3d2e787ac6d6fd49ec52ede604fd0ce.tar.gz
rneovim-dff684fdb3d2e787ac6d6fd49ec52ede604fd0ce.tar.bz2
rneovim-dff684fdb3d2e787ac6d6fd49ec52ede604fd0ce.zip
feat(lsp)!: support multiple clients in lsp.buf.references
Relates to: - https://github.com/neovim/neovim/issues/17712 - https://github.com/neovim/neovim/issues/30034
Diffstat (limited to 'runtime/lua/vim/lsp/handlers.lua')
-rw-r--r--runtime/lua/vim/lsp/handlers.lua25
1 files changed, 0 insertions, 25 deletions
diff --git a/runtime/lua/vim/lsp/handlers.lua b/runtime/lua/vim/lsp/handlers.lua
index 8e538242d9..3306e480dd 100644
--- a/runtime/lua/vim/lsp/handlers.lua
+++ b/runtime/lua/vim/lsp/handlers.lua
@@ -242,31 +242,6 @@ M[ms.textDocument_inlayHint] = function(...)
return vim.lsp.inlay_hint.on_inlayhint(...)
end
---- @see # https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_references
-M[ms.textDocument_references] = function(_, result, ctx, config)
- if not result or vim.tbl_isempty(result) then
- vim.notify('No references found')
- return
- end
-
- local client = assert(vim.lsp.get_client_by_id(ctx.client_id))
- config = config or {}
- local title = 'References'
- local items = util.locations_to_items(result, client.offset_encoding)
-
- local list = { title = title, items = items, context = ctx }
- if config.loclist then
- vim.fn.setloclist(0, {}, ' ', list)
- vim.cmd.lopen()
- elseif config.on_list then
- assert(vim.is_callable(config.on_list), 'on_list is not a function')
- config.on_list(list)
- else
- vim.fn.setqflist({}, ' ', list)
- vim.cmd('botright copen')
- end
-end
-
--- Return a function that converts LSP responses to list items and opens the list
---
--- The returned function has an optional {config} parameter that accepts |vim.lsp.ListOpts|