diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2021-12-30 16:12:46 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2021-12-30 16:12:46 +0800 |
commit | a48139e5dd7e7a6e9e3bd00a41334a1e66d1a227 (patch) | |
tree | b363a6a733280839bb3d2170e26668143106ee9f /script/core | |
parent | f0f9a4ea4509dfb764a5dfebd5e86e679c8f4b03 (diff) | |
download | lua-language-server-a48139e5dd7e7a6e9e3bd00a41334a1e66d1a227.zip |
update
Diffstat (limited to 'script/core')
-rw-r--r-- | script/core/hover/description.lua | 8 |
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) |