summaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-04-07 00:43:00 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-04-07 00:43:00 +0800
commite250b80fbc3ee9f69fd5ed78fa4f858925c182fd (patch)
treed06255f6713fdeb358dbc37e2d80ab2f1fba9267 /script
parentfa430fa6225ea1c78ffc263bf0e9bb612fc15a03 (diff)
downloadlua-language-server-e250b80fbc3ee9f69fd5ed78fa4f858925c182fd.zip
update
Diffstat (limited to 'script')
-rw-r--r--script/vm/compiler.lua15
1 files changed, 14 insertions, 1 deletions
diff --git a/script/vm/compiler.lua b/script/vm/compiler.lua
index 7c5eb721..57816e24 100644
--- a/script/vm/compiler.lua
+++ b/script/vm/compiler.lua
@@ -362,7 +362,6 @@ local function getReturn(func, index, args)
end
local function bindDocs(source)
- local hasFounded = false
local isParam = source.parent.type == 'funcargs'
or source.parent.type == 'in'
local docs = source.bindDocs
@@ -389,6 +388,20 @@ local function bindDocs(source)
return true
end
end
+ if doc.type == 'doc.module' then
+ local name = doc.module
+ local uri = rpath.findUrisByRequirePath(guide.getUri(source), name)[1]
+ if not uri then
+ return nil
+ end
+ local state = files.getState(uri)
+ local ast = state and state.ast
+ if not ast then
+ return nil
+ end
+ nodeMgr.setNode(source, m.compileNode(ast))
+ return true
+ end
end
return false
end