summaryrefslogtreecommitdiff
path: root/test/definition/special.lua
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-02-25 18:08:05 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-02-25 18:08:05 +0800
commit4508b4018dced01fe5420e008e813199d0ce856f (patch)
tree4c1938a91270f91945be20a5e0bd489ff08a3994 /test/definition/special.lua
parent674eb3f23cc00d2f679281abe16634f6b1663d31 (diff)
downloadlua-language-server-4508b4018dced01fe5420e008e813199d0ce856f.zip
update
Diffstat (limited to 'test/definition/special.lua')
-rw-r--r--test/definition/special.lua36
1 files changed, 20 insertions, 16 deletions
diff --git a/test/definition/special.lua b/test/definition/special.lua
index 3f0d076a..531c5d93 100644
--- a/test/definition/special.lua
+++ b/test/definition/special.lua
@@ -32,24 +32,28 @@ local obj = setmetatable({}, { __index = mt })
obj:<?method1?>()
]]
-TEST [[
-local mt
-function mt:<!method1!>()
-end
-
-setmetatable(api, { __index = mt })
-api:<?method1?>()
-]]
+-- 不再支持在变量的引用中使用 setmetatable 操作。
+-- 这会将引用转换为定义,为了搜索定义去检查引用性价比太差了。
+-- 如果有必要,请使用 ---@class 系统。
-TEST [[
-local mt
-local api
-function mt:<!method1!>()
-end
+--TEST [[
+--local mt
+--function mt:<!method1!>()
+--end
+--
+--setmetatable(api, { __index = mt })
+--api:<?method1?>()
+--]]
-setmetatable(api, { __index = mt })
-api:<?method1?>()
-]]
+--TEST [[
+--local mt
+--local api
+--function mt:<!method1!>()
+--end
+--
+--setmetatable(api, { __index = mt })
+--api:<?method1?>()
+--]]
-- TODO 不支持从方法内部找外部的赋值
--TEST [[