From 9a24fa993879985468c291eb9f1003e8b8f5b4ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Mon, 14 Dec 2020 15:47:43 +0800 Subject: `undefined-field` select field only --- test/diagnostics/init.lua | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'test/diagnostics') 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( + 1) +print(v. + 1) print(v:method1()) print(v.method2()) -print(()) +print(v:()) ---@type Bar local v2 print(v2.field1 + 1) print(v2.field2 + 1) -print( + 1) +print(v2. + 1) print(v2.field4 + 1) print(v2:method1()) print(v2.method2()) -print(()) +print(v2:()) local v3 = {} print(v3.abc) @@ -880,7 +880,7 @@ function Foo:method1() end ---@type Foo local v v:method1() -() -- doc.class.name +v:() -- doc.class.name ]] -- checkUndefinedField 通过type找到class,涉及到 class 继承版 @@ -895,7 +895,7 @@ function Bar:method3() end ---@type Bar local v v:method1() -() -- doc.class.name +v:() -- doc.class.name v:method3() ]] @@ -904,8 +904,8 @@ TEST [[ ---@class Foo local Foo function Foo:method1() end -() -- doc.class -() -- doc.class +Foo:() -- doc.class +Foo:() -- doc.class ]] -- checkUndefinedField 没有@class的不检测 @@ -921,9 +921,9 @@ TEST [[ ---@class Foo local mt function mt:method1() - () -- doc.class + mt.() -- doc.class self.method1() - return () -- doc.class.name + return self.() -- doc.class.name end ]] -- cgit v1.2.3