summaryrefslogtreecommitdiff
path: root/script/core
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-12-30 16:12:46 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-12-30 16:12:46 +0800
commita48139e5dd7e7a6e9e3bd00a41334a1e66d1a227 (patch)
treeb363a6a733280839bb3d2170e26668143106ee9f /script/core
parentf0f9a4ea4509dfb764a5dfebd5e86e679c8f4b03 (diff)
downloadlua-language-server-a48139e5dd7e7a6e9e3bd00a41334a1e66d1a227.zip
update
Diffstat (limited to 'script/core')
-rw-r--r--script/core/hover/description.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/script/core/hover/description.lua b/script/core/hover/description.lua
index 59605f0d..c5a42a32 100644
--- a/script/core/hover/description.lua
+++ b/script/core/hover/description.lua
@@ -11,8 +11,8 @@ local guide = require 'parser.guide'
local noder = require 'core.noder'
local rpath = require 'workspace.require-path'
-local function collectRequire(mode, literal)
- local rootPath = ws.rootPath or ''
+local function collectRequire(mode, literal, uri)
+ local rootPath = ws.getRootUri(uri) or ''
local result, searchers
if mode == 'require' then
result, searchers = rpath.findUrisByRequirePath(literal)
@@ -57,7 +57,7 @@ local function asStringInRequire(source, literal)
if libName == 'require'
or libName == 'dofile'
or libName == 'loadfile' then
- return collectRequire(libName, literal)
+ return collectRequire(libName, literal, guide.getUri(source))
end
end
end
@@ -157,7 +157,7 @@ local function tryDocModule(source)
if not source.module then
return
end
- return collectRequire('require', source.module)
+ return collectRequire('require', source.module, guide.getUri(source))
end
local function buildEnumChunk(docType, name)