From 1e3726e3d3f6c84ce29e857181261b5ffb2d0da3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Fri, 6 Dec 2019 17:47:52 +0800 Subject: =?UTF-8?q?=E6=9A=82=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- script-beta/core/hover/label.lua | 1 + script-beta/vm/eachRef.lua | 21 ++++++++++++++++++--- 2 files changed, 19 insertions(+), 3 deletions(-) (limited to 'script-beta') 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 -- cgit v1.2.3