summaryrefslogtreecommitdiff
path: root/script-beta/vm/getLibrary.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2019-12-09 15:00:29 +0800
committer最萌小汐 <sumneko@hotmail.com>2019-12-09 15:00:29 +0800
commit9f621b6076181e577748dda3966bbc526586445d (patch)
tree05057166585d0f229030c44718312432ab163dc7 /script-beta/vm/getLibrary.lua
parent1e3726e3d3f6c84ce29e857181261b5ffb2d0da3 (diff)
downloadlua-language-server-9f621b6076181e577748dda3966bbc526586445d.zip
支持看lib的table
Diffstat (limited to 'script-beta/vm/getLibrary.lua')
-rw-r--r--script-beta/vm/getLibrary.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/script-beta/vm/getLibrary.lua b/script-beta/vm/getLibrary.lua
index 959b7084..d2f88116 100644
--- a/script-beta/vm/getLibrary.lua
+++ b/script-beta/vm/getLibrary.lua
@@ -3,6 +3,9 @@ local library = require 'library'
local guide = require 'parser.guide'
local function checkStdLibrary(source)
+ if source.library then
+ return source
+ end
local globalName = vm.getGlobal(source)
if not globalName then
return nil
@@ -73,7 +76,7 @@ local function getLibrary(source)
return lib
end
return checkNode(source) or vm.eachRef(source, function (info)
- return checkNode(info.source)
+ return checkStdLibrary(info.source) or checkNode(info.source)
end)
end