summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2019-12-04 15:58:32 +0800
committer最萌小汐 <sumneko@hotmail.com>2019-12-04 15:58:32 +0800
commit96e499f4c62d7e444c74a4afebfd02211f3f9c16 (patch)
treea140dc162f2164b925ea1a529911abddb0113909
parent33ca6151e44074754373a1eeebbd5f53e92f4fae (diff)
downloadlua-language-server-96e499f4c62d7e444c74a4afebfd02211f3f9c16.zip
暂时这么支持特殊call
-rw-r--r--script-beta/vm/eachRef.lua1
-rw-r--r--test-beta/references/init.lua15
2 files changed, 16 insertions, 0 deletions
diff --git a/script-beta/vm/eachRef.lua b/script-beta/vm/eachRef.lua
index 9ab9d6cf..8c203cfa 100644
--- a/script-beta/vm/eachRef.lua
+++ b/script-beta/vm/eachRef.lua
@@ -481,6 +481,7 @@ local function eachRef(source, callback)
ofValue(source, callback)
elseif stype == 'call' then
ofCall(source.node, 1, callback)
+ ofSpecialCall(source, source.node, 1, callback)
elseif stype == 'main' then
ofMain(source, callback)
end
diff --git a/test-beta/references/init.lua b/test-beta/references/init.lua
index 4cd21e2b..4a122b7a 100644
--- a/test-beta/references/init.lua
+++ b/test-beta/references/init.lua
@@ -177,6 +177,21 @@ end
local <!y!> = f()()
]]
+TEST [[
+local mt = {}
+mt.__index = mt
+
+function mt:<!add!>(a, b)
+end
+
+local function init()
+ return setmetatable({}, mt)
+end
+
+local t = init()
+t:<?add?>()
+]]
+
--TEST [[
-----@class <!Class!>
-----@type <?Class?>