Skip to content

Commit 2e8991e

Browse files
authored
fix(lsp_locations): expand filename when rendering lsp locations (#700)
1 parent c165556 commit 2e8991e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lua/fzfx/cfg/_lsp_locations.lua

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ M._render_lsp_location_line = function(loc)
122122
if not M._is_lsp_range(range) then
123123
return nil
124124
end
125+
filename = path.normalize(filename, { double_backslash = true, expand = true })
125126
if type(filename) ~= "string" or vim.fn.filereadable(filename) <= 0 then
126127
return nil
127128
end
@@ -306,6 +307,7 @@ M._render_lsp_call_hierarchy_line = function(item, ranges)
306307
local filename = nil
307308
if type(item.uri) == "string" and string.len(item.uri) > 0 and M._is_lsp_range(item.range) then
308309
filename = path.reduce(vim.uri_to_fname(item.uri))
310+
filename = path.normalize(filename, { double_backslash = true, expand = true })
309311
-- log.debug("|_render_lsp_call_hierarchy_line| location filename: " .. vim.inspect(filename))
310312
end
311313
if type(ranges) ~= "table" or #ranges == 0 then

0 commit comments

Comments
 (0)