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