summaryrefslogtreecommitdiff
path: root/script-beta
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2019-12-06 17:47:52 +0800
committer最萌小汐 <sumneko@hotmail.com>2019-12-06 17:47:52 +0800
commit1e3726e3d3f6c84ce29e857181261b5ffb2d0da3 (patch)
tree6029b3e0e3bbd072790a5f00152fa2efb0cfa071 /script-beta
parent61304827140ac8940e74ce9876c772d021cc926a (diff)
downloadlua-language-server-1e3726e3d3f6c84ce29e857181261b5ffb2d0da3.zip
暂存
Diffstat (limited to 'script-beta')
-rw-r--r--script-beta/core/hover/label.lua1
-rw-r--r--script-beta/vm/eachRef.lua21
2 files changed, 19 insertions, 3 deletions
diff --git a/script-beta/core/hover/label.lua b/script-beta/core/hover/label.lua
index 799ad662..bcc65b8d 100644
--- a/script-beta/core/hover/label.lua
+++ b/script-beta/core/hover/label.lua
@@ -18,6 +18,7 @@ end
local function asValue(source, title)
local name = buildName(source)
+ local lib = vm.getLibrary(source)
local class = getClass(source)
local type = vm.getType(source)
local literal = vm.getLiteral(source)
diff --git a/script-beta/vm/eachRef.lua b/script-beta/vm/eachRef.lua
index 8c203cfa..d990ee1a 100644
--- a/script-beta/vm/eachRef.lua
+++ b/script-beta/vm/eachRef.lua
@@ -1,6 +1,7 @@
-local guide = require 'parser.guide'
-local files = require 'files'
-local vm = require 'vm.vm'
+local guide = require 'parser.guide'
+local files = require 'files'
+local vm = require 'vm.vm'
+local library = require 'library'
local function ofCall(func, index, callback)
vm.eachRef(func, function (info)
@@ -115,6 +116,20 @@ local function ofSpecialCall(call, func, index, callback)
end
end
end
+
+ local args = call.args
+ if args[1] then
+ if args[1].type == 'string' then
+ local objName = args[1][1]
+ local lib = library.library[objName]
+ if lib then
+ callback {
+ source = lib,
+ mode = 'library',
+ }
+ end
+ end
+ end
end
end
end