aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/lsp/handlers.lua
diff options
context:
space:
mode:
authortom-anders <13141438+tom-anders@users.noreply.github.com>2024-05-04 10:13:08 +0200
committertom-anders <13141438+tom-anders@users.noreply.github.com>2024-05-07 21:34:28 +0200
commit5c40f3e86a81f78f821b8c75dafc3ce2ce67e1c5 (patch)
tree0d55dc618b4d90a4147d337bc175fe649199b757 /runtime/lua/vim/lsp/handlers.lua
parentb0cc85c00504dc5530ab5d6c5fa03f3fa96d5a1a (diff)
downloadrneovim-5c40f3e86a81f78f821b8c75dafc3ce2ce67e1c5.tar.gz
rneovim-5c40f3e86a81f78f821b8c75dafc3ce2ce67e1c5.tar.bz2
rneovim-5c40f3e86a81f78f821b8c75dafc3ce2ce67e1c5.zip
feat(lsp): support vim.lsp.ListOpts.loclist in location_handler()
Diffstat (limited to 'runtime/lua/vim/lsp/handlers.lua')
-rw-r--r--runtime/lua/vim/lsp/handlers.lua9
1 files changed, 7 insertions, 2 deletions
diff --git a/runtime/lua/vim/lsp/handlers.lua b/runtime/lua/vim/lsp/handlers.lua
index 205de68101..eec16d7298 100644
--- a/runtime/lua/vim/lsp/handlers.lua
+++ b/runtime/lua/vim/lsp/handlers.lua
@@ -443,8 +443,13 @@ local function location_handler(_, result, ctx, config)
util.jump_to_location(result[1], client.offset_encoding, config.reuse_win)
return
end
- vim.fn.setqflist({}, ' ', { title = title, items = items })
- vim.cmd('botright copen')
+ if config.loclist then
+ vim.fn.setloclist(0, {}, ' ', { title = title, items = items })
+ vim.cmd.lopen()
+ else
+ vim.fn.setqflist({}, ' ', { title = title, items = items })
+ vim.cmd('botright copen')
+ end
end
--- @see # https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_declaration