mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
fix(lsp): fetch offset_encoding from client in references (#17104)
This commit is contained in:
parent
561df30981
commit
a0201b6ed3
@ -166,18 +166,19 @@ M['textDocument/references'] = function(_, result, ctx, config)
|
||||
if not result or vim.tbl_isempty(result) then
|
||||
vim.notify('No references found')
|
||||
else
|
||||
local client = vim.lsp.get_client_by_id(ctx.client_id)
|
||||
config = config or {}
|
||||
if config.loclist then
|
||||
vim.fn.setloclist(0, {}, ' ', {
|
||||
title = 'References';
|
||||
items = util.locations_to_items(result, ctx.offset_encoding);
|
||||
items = util.locations_to_items(result, client.offset_encoding);
|
||||
context = ctx;
|
||||
})
|
||||
api.nvim_command("lopen")
|
||||
else
|
||||
vim.fn.setqflist({}, ' ', {
|
||||
title = 'References';
|
||||
items = util.locations_to_items(result, ctx.offset_encoding);
|
||||
items = util.locations_to_items(result, client.offset_encoding);
|
||||
context = ctx;
|
||||
})
|
||||
api.nvim_command("botright copen")
|
||||
|
Loading…
Reference in New Issue
Block a user