summaryrefslogtreecommitdiff
path: root/script-beta/vm/getLibrary.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2020-11-16 14:07:10 +0800
committer最萌小汐 <sumneko@hotmail.com>2020-11-16 14:07:10 +0800
commit7e97893e92f694b65f58630cba04d0732ca75e23 (patch)
treeea0cf3856fa419ad28f7fbb555d449aed41a248a /script-beta/vm/getLibrary.lua
parent8c464f8fa237d85d2c99c7b36d8a62d9bcecda81 (diff)
downloadlua-language-server-7e97893e92f694b65f58630cba04d0732ca75e23.zip
整理代码
Diffstat (limited to 'script-beta/vm/getLibrary.lua')
-rw-r--r--script-beta/vm/getLibrary.lua8
1 files changed, 8 insertions, 0 deletions
diff --git a/script-beta/vm/getLibrary.lua b/script-beta/vm/getLibrary.lua
index 36d53c84..86f1ae58 100644
--- a/script-beta/vm/getLibrary.lua
+++ b/script-beta/vm/getLibrary.lua
@@ -55,6 +55,14 @@ function vm.getLibrary(source, deep)
end
end
+function vm.getLibraryName(source, deep)
+ local lib = vm.getLibrary(source, deep)
+ if lib then
+ return lib.name
+ end
+ return nil
+end
+
local globalLibraryNames = {
'arg', 'assert', 'collectgarbage', 'dofile', '_G', 'getfenv',
'getmetatable', 'ipairs', 'load', 'loadfile', 'loadstring',