summaryrefslogtreecommitdiff
path: root/lua
diff options
context:
space:
mode:
authorChinmay Dalal <dalal.chinmay.0101@gmail.com>2022-01-18 12:40:15 +0530
committerGitHub <noreply@github.com>2022-01-18 08:10:15 +0100
commit0011b1148d3975600f5a9f0be8058cdaac4e30d9 (patch)
tree30794407e514328d728d3779701c734afb888410 /lua
parent2cb7e11cc151c42e2981b2a460bbbe4ded5be5ee (diff)
fix: add offset encoding to `vim.lsp.util.locations_to_items()` call (#1694)
Diffstat (limited to 'lua')
-rw-r--r--lua/telescope/builtin/lsp.lua7
1 files changed, 5 insertions, 2 deletions
diff --git a/lua/telescope/builtin/lsp.lua b/lua/telescope/builtin/lsp.lua
index 737cad1..266d1df 100644
--- a/lua/telescope/builtin/lsp.lua
+++ b/lua/telescope/builtin/lsp.lua
@@ -16,7 +16,7 @@ lsp.references = function(opts)
local params = vim.lsp.util.make_position_params()
params.context = { includeDeclaration = true }
- vim.lsp.buf_request(0, "textDocument/references", params, function(err, result, _ctx, _config)
+ vim.lsp.buf_request(0, "textDocument/references", params, function(err, result, ctx, _config)
if err then
vim.api.nvim_err_writeln("Error when finding references: " .. err.message)
return
@@ -24,7 +24,10 @@ lsp.references = function(opts)
local locations = {}
if result then
- vim.list_extend(locations, vim.lsp.util.locations_to_items(result) or {})
+ vim.list_extend(
+ locations,
+ vim.lsp.util.locations_to_items(result, vim.lsp.get_client_by_id(ctx.client_id).offset_encoding) or {}
+ )
end
if vim.tbl_isempty(locations) then