Skip to content

Commit

Permalink
fix(lsp): handle URI in item_to_location (#3144)
Browse files Browse the repository at this point in the history
  • Loading branch information
lawrenceho committed May 29, 2024
1 parent 90143d3 commit dfa230b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lua/telescope/builtin/__lsp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,14 @@ end
local function item_to_location(item, offset_encoding)
local line = item.lnum - 1
local character = vim.lsp.util._str_utfindex_enc(item.text, item.col, offset_encoding) - 1
local uri
if utils.is_uri(item.filename) then
uri = item.filename
else
uri = vim.uri_from_fname(item.filename)
end
return {
uri = vim.uri_from_fname(item.filename),
uri = uri,
range = {
start = {
line = line,
Expand Down

0 comments on commit dfa230b

Please sign in to comment.