summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2020-12-14 15:47:43 +0800
committer最萌小汐 <sumneko@hotmail.com>2020-12-14 15:47:43 +0800
commit9a24fa993879985468c291eb9f1003e8b8f5b4ce (patch)
tree2eea7714d82c2e9cf39790568f3c234fb34c006f /test
parent98bf48a28b34a8437904675d61eeb960a20b8833 (diff)
downloadlua-language-server-9a24fa993879985468c291eb9f1003e8b8f5b4ce.zip
`undefined-field` select field only
Diffstat (limited to 'test')
-rw-r--r--test/diagnostics/init.lua20
1 files changed, 10 insertions, 10 deletions
diff --git a/test/diagnostics/init.lua b/test/diagnostics/init.lua
index 3f3c563c..cfd0f4cb 100644
--- a/test/diagnostics/init.lua
+++ b/test/diagnostics/init.lua
@@ -847,20 +847,20 @@ local mt2 = {}
local v
print(v.field1 + 1)
print(v.field2 + 1)
-print(<!v.field3!> + 1)
+print(v.<!field3!> + 1)
print(v:method1())
print(v.method2())
-print(<!v:method3!>())
+print(v:<!method3!>())
---@type Bar
local v2
print(v2.field1 + 1)
print(v2.field2 + 1)
-print(<!v2.field3!> + 1)
+print(v2.<!field3!> + 1)
print(v2.field4 + 1)
print(v2:method1())
print(v2.method2())
-print(<!v2:method3!>())
+print(v2:<!method3!>())
local v3 = {}
print(v3.abc)
@@ -880,7 +880,7 @@ function Foo:method1() end
---@type Foo
local v
v:method1()
-<!v:method2!>() -- doc.class.name
+v:<!method2!>() -- doc.class.name
]]
-- checkUndefinedField 通过type找到class,涉及到 class 继承版
@@ -895,7 +895,7 @@ function Bar:method3() end
---@type Bar
local v
v:method1()
-<!v:method2!>() -- doc.class.name
+v:<!method2!>() -- doc.class.name
v:method3()
]]
@@ -904,8 +904,8 @@ TEST [[
---@class Foo
local Foo
function Foo:method1() end
-<!Foo:method2!>() -- doc.class
-<!Foo:method2!>() -- doc.class
+Foo:<!method2!>() -- doc.class
+Foo:<!method2!>() -- doc.class
]]
-- checkUndefinedField 没有@class的不检测
@@ -921,9 +921,9 @@ TEST [[
---@class Foo
local mt
function mt:method1()
- <!mt.method2!>() -- doc.class
+ mt.<!method2!>() -- doc.class
self.method1()
- return <!self.method2!>() -- doc.class.name
+ return self.<!method2!>() -- doc.class.name
end
]]