diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2020-05-29 18:14:10 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2020-05-29 18:14:10 +0800 |
commit | 0c009afbc73804259e1da0cf2b7a6a69ca728cee (patch) | |
tree | cb03c2ea1190330f3a50eb4420af90f8647bc5c5 /script-beta/vm/getLibrary.lua | |
parent | a053400c28129d0e9e2e4ab9683495651c2a4dbc (diff) | |
download | lua-language-server-0c009afbc73804259e1da0cf2b7a6a69ca728cee.zip |
更新
Diffstat (limited to 'script-beta/vm/getLibrary.lua')
-rw-r--r-- | script-beta/vm/getLibrary.lua | 13 |
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) |