fix(lsp): handle URI in item_to_location (#3144)

This commit is contained in:
Lawrence Ho
2024-05-30 01:24:09 +08:00
committed by GitHub
parent 90143d31f2
commit dfa230be84

View File

@@ -106,8 +106,14 @@ end
local function item_to_location(item, offset_encoding) local function item_to_location(item, offset_encoding)
local line = item.lnum - 1 local line = item.lnum - 1
local character = vim.lsp.util._str_utfindex_enc(item.text, item.col, offset_encoding) - 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 { return {
uri = vim.uri_from_fname(item.filename), uri = uri,
range = { range = {
start = { start = {
line = line, line = line,