fix: handle non-file uris for lsp (#2604)

This commit is contained in:
TJ DeVries
2023-07-17 13:20:09 -04:00
committed by GitHub
parent 2ea8dcd17b
commit 47c755d737
2 changed files with 10 additions and 4 deletions

View File

@@ -173,8 +173,9 @@ utils.is_path_hidden = function(opts, path_display)
or type(path_display) == "table" and (vim.tbl_contains(path_display, "hidden") or path_display.hidden)
end
local is_uri = function(filename)
return string.match(filename, "^%w+://") ~= nil
local URI_SCHEME_PATTERN = "^([a-zA-Z]+[a-zA-Z0-9.+-]*):.*"
utils.is_uri = function(filename)
return filename:match(URI_SCHEME_PATTERN) ~= nil
end
local calc_result_length = function(truncate_len)
@@ -197,7 +198,7 @@ utils.transform_path = function(opts, path)
if path == nil then
return
end
if is_uri(path) then
if utils.is_uri(path) then
return path
end