mirror of
https://github.com/neovim/neovim
synced 2025-07-16 09:11:51 +00:00
feat(lsp): support vim.lsp.ListOpts.loclist in location_handler()
This commit is contained in:
@ -266,6 +266,9 @@ The following new APIs and features were added.
|
|||||||
respective capability can be unset.
|
respective capability can be unset.
|
||||||
• |vim.lsp.start()| accepts a "silent" option for suppressing messages
|
• |vim.lsp.start()| accepts a "silent" option for suppressing messages
|
||||||
if an LSP server failed to start.
|
if an LSP server failed to start.
|
||||||
|
• |vim.lsp.buf.definition()|, |vim.lsp.buf.declaration()|,
|
||||||
|
|vim.lsp.buf.type_definition()|, and |vim.lsp.buf.implementation()| now
|
||||||
|
support the `loclist` field of |vim.lsp.ListOpts|.
|
||||||
|
|
||||||
• Treesitter
|
• Treesitter
|
||||||
• Bundled parsers and queries (highlight, folds) for Markdown, Python, and
|
• Bundled parsers and queries (highlight, folds) for Markdown, Python, and
|
||||||
|
@ -443,8 +443,13 @@ local function location_handler(_, result, ctx, config)
|
|||||||
util.jump_to_location(result[1], client.offset_encoding, config.reuse_win)
|
util.jump_to_location(result[1], client.offset_encoding, config.reuse_win)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
vim.fn.setqflist({}, ' ', { title = title, items = items })
|
if config.loclist then
|
||||||
vim.cmd('botright copen')
|
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
|
end
|
||||||
|
|
||||||
--- @see # https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_declaration
|
--- @see # https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_declaration
|
||||||
|
Reference in New Issue
Block a user