summaryrefslogtreecommitdiff
path: root/script-beta/vm/getLibrary.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2020-05-29 18:14:10 +0800
committer最萌小汐 <sumneko@hotmail.com>2020-05-29 18:14:10 +0800
commit0c009afbc73804259e1da0cf2b7a6a69ca728cee (patch)
treecb03c2ea1190330f3a50eb4420af90f8647bc5c5 /script-beta/vm/getLibrary.lua
parenta053400c28129d0e9e2e4ab9683495651c2a4dbc (diff)
downloadlua-language-server-0c009afbc73804259e1da0cf2b7a6a69ca728cee.zip
更新
Diffstat (limited to 'script-beta/vm/getLibrary.lua')
-rw-r--r--script-beta/vm/getLibrary.lua13
1 files changed, 4 insertions, 9 deletions
diff --git a/script-beta/vm/getLibrary.lua b/script-beta/vm/getLibrary.lua
index ac6402de..8088917a 100644
--- a/script-beta/vm/getLibrary.lua
+++ b/script-beta/vm/getLibrary.lua
@@ -6,11 +6,10 @@ local function checkStdLibrary(source)
if source.library then
return source
end
- local globalName = vm.getGlobal(source)
- if not globalName then
+ local name = guide.getName(source)
+ if not name then
return nil
end
- local name = globalName:match '^s|(.+)$'
if library.global[name] then
return library.global[name]
end
@@ -30,12 +29,8 @@ end
local function getNodeAsTable(source)
local node = source.node
- local nodeGlobalName = vm.getGlobal(node)
- if not nodeGlobalName then
- return nil
- end
- local nodeName = nodeGlobalName:match '^s|(.+)$'
- return getLibInNode(source, library.global[nodeName])
+ local name = guide.getName(node)
+ return getLibInNode(source, library.global[name])
end
local function getNodeAsObject(source)