summaryrefslogtreecommitdiff
path: root/script/core
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-01-13 11:48:05 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-01-13 11:48:05 +0800
commit8fcde49b035e9d0947035162bacd88a2e2465e19 (patch)
treeda5bfbdd046bd90a1c87d07d33affa3adb599b07 /script/core
parent16376c869290d19ac99fb9906bde4817de79bef9 (diff)
downloadlua-language-server-8fcde49b035e9d0947035162bacd88a2e2465e19.zip
add detail for require name
Diffstat (limited to 'script/core')
-rw-r--r--script/core/completion/completion.lua11
1 files changed, 7 insertions, 4 deletions
diff --git a/script/core/completion/completion.lua b/script/core/completion/completion.lua
index 6edfac91..124ebee1 100644
--- a/script/core/completion/completion.lua
+++ b/script/core/completion/completion.lua
@@ -894,7 +894,8 @@ local function collectRequireNames(mode, myUri, literal, source, smark, position
start = smark and (source.start + #smark) or position,
finish = smark and (source.finish - #smark) or position,
newText = smark and info.expect or util.viewString(info.expect),
- }
+ },
+ path = path,
}
end
if vm.isMetaFile(uri) then
@@ -921,7 +922,8 @@ local function collectRequireNames(mode, myUri, literal, source, smark, position
start = smark and (source.start + #smark) or position,
finish = smark and (source.finish - #smark) or position,
newText = smark and open or util.viewString(open),
- }
+ },
+ path = path,
}
end
collect[open][#collect[open]+1] = ([=[* [%s](%s)]=]):format(
@@ -969,8 +971,9 @@ local function collectRequireNames(mode, myUri, literal, source, smark, position
end
end
results[#results+1] = {
- label = label,
- kind = define.CompletionItemKind.File,
+ label = label,
+ detail = infos.path,
+ kind = define.CompletionItemKind.File,
description = table.concat(des, '\n'),
textEdit = infos.textEdit,
}