diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-04-08 13:12:31 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-04-08 13:12:31 +0800 |
commit | 3771e70b48e9a088cbdc11a8b952d525eea1e7c9 (patch) | |
tree | 065b1c5501dfaf1aef5c484f6128bc61cc75d054 /script/vm/getLibrary.lua | |
parent | b8c5db4d443e5a0c638d964104d8966f837eeb6a (diff) | |
download | lua-language-server-3771e70b48e9a088cbdc11a8b952d525eea1e7c9.zip |
cleanup
Diffstat (limited to 'script/vm/getLibrary.lua')
-rw-r--r-- | script/vm/getLibrary.lua | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/script/vm/getLibrary.lua b/script/vm/getLibrary.lua deleted file mode 100644 index 1a8d8ffd..00000000 --- a/script/vm/getLibrary.lua +++ /dev/null @@ -1,36 +0,0 @@ ----@class vm -local vm = require 'vm.vm' - -function vm.getLibraryName(source) - if source.special then - return source.special - end - local defs = vm.getDefs(source) - for _, def in ipairs(defs) do - if def.special then - return def.special - end - end - return nil -end - -local globalLibraryNames = { - 'arg', 'assert', 'error', 'collectgarbage', 'dofile', '_G', 'getfenv', - 'getmetatable', 'ipairs', 'load', 'loadfile', 'loadstring', - 'module', 'next', 'pairs', 'pcall', 'print', 'rawequal', - 'rawget', 'rawlen', 'rawset', 'select', 'setfenv', - 'setmetatable', 'tonumber', 'tostring', 'type', '_VERSION', - 'warn', 'xpcall', 'require', 'unpack', 'bit32', 'coroutine', - 'debug', 'io', 'math', 'os', 'package', 'string', 'table', - 'utf8', -} -local globalLibraryNamesMap -function vm.isGlobalLibraryName(name) - if not globalLibraryNamesMap then - globalLibraryNamesMap = {} - for _, v in ipairs(globalLibraryNames) do - globalLibraryNamesMap[v] = true - end - end - return globalLibraryNamesMap[name] or false -end |