summaryrefslogtreecommitdiff
path: root/script/core
diff options
context:
space:
mode:
authorsumneko <sumneko@hotmail.com>2022-01-23 18:40:04 +0800
committersumneko <sumneko@hotmail.com>2022-01-23 18:40:04 +0800
commit48f59772c3fdf2fdc5a250f8f770ad16f1f0b3ab (patch)
tree2a525620e592fe81c55205db645aae8fd5cdbc66 /script/core
parent37b5f6cdb45651487792758a931203a54af3dd29 (diff)
downloadlua-language-server-48f59772c3fdf2fdc5a250f8f770ad16f1f0b3ab.zip
show relative path in completion
Diffstat (limited to 'script/core')
-rw-r--r--script/core/completion/completion.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/script/core/completion/completion.lua b/script/core/completion/completion.lua
index 16cecd04..099bdc47 100644
--- a/script/core/completion/completion.lua
+++ b/script/core/completion/completion.lua
@@ -886,6 +886,7 @@ local function collectRequireNames(mode, myUri, literal, source, smark, position
end
local path = furi.decode(uri)
local infos = rpath.getVisiblePath(uri, path)
+ local relative = workspace.getRelativePath(path)
for _, info in ipairs(infos) do
if matchKey(literal, info.expect) then
if not collect[info.expect] then
@@ -895,14 +896,14 @@ local function collectRequireNames(mode, myUri, literal, source, smark, position
finish = smark and (source.finish - #smark) or position,
newText = smark and info.expect or util.viewString(info.expect),
},
- path = path,
+ path = relative,
}
end
if vm.isMetaFile(uri) then
collect[info.expect][#collect[info.expect]+1] = ('* [[meta]](%s)'):format(uri)
else
collect[info.expect][#collect[info.expect]+1] = ([=[* [%s](%s) %s]=]):format(
- path,
+ relative,
uri,
lang.script('HOVER_USE_LUA_PATH', info.searcher)
)