summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-03-04 18:04:45 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-03-04 18:04:45 +0800
commit513023b9ee1d4af55e43d530fe5ed1092beb79ce (patch)
tree220ec707146154bf752d862e446531a64e402ce7 /test
parent80aea7f979bbbacad94d10a88514c7bddf6d11cf (diff)
downloadlua-language-server-513023b9ee1d4af55e43d530fe5ed1092beb79ce.zip
update
Diffstat (limited to 'test')
-rw-r--r--test/definition/luadoc.lua53
-rw-r--r--test/type_inference/init.lua19
2 files changed, 22 insertions, 50 deletions
diff --git a/test/definition/luadoc.lua b/test/definition/luadoc.lua
index 58260849..61477b0d 100644
--- a/test/definition/luadoc.lua
+++ b/test/definition/luadoc.lua
@@ -192,7 +192,7 @@ y.<?a?>
TEST [[
---@class <!loli!>
-local unit
+local unit!>
function unit:pants()
end
@@ -223,53 +223,6 @@ AAAA.a.<?SSDF?>
]]
TEST [[
----@class Cat
-local <!m!> ---hahaha
----@class Dog
-local m2
----@type Cat
-local <?<!v!>?>
-]]
-
-TEST [[
----@class Cat
-local <!m!> --hahaha
----@class Dog
-local m2
----@type Cat
-local <?<!v!>?>
-]]
-
-TEST [[
----@class Cat
- local <!m!> ---hahaha
-
- ---@class Dog
- local m2
- ---@type Cat
- local <?<!v!>?>
-]]
-
-TEST [[
----@class A
-local A
-
----@return A
-function A:x() end
-
----@class B: A
-local <!B!>
-
----@return B
-function B:x() end
-
----@type B
-local t
-
-local <!<?v?>!> = t.x()
-]]
-
-TEST [[
---@return <!fun()!>
local function f() end
@@ -282,8 +235,8 @@ TEST [[
---@return T
local function f(p) end
-local <!k!>
-local <?<!r!>?> = f(<!k!>)
+local k = <!{}!>
+local <?<!r!>?> = f(k)
]]
TEST [[
diff --git a/test/type_inference/init.lua b/test/type_inference/init.lua
index ef2d1f62..46c5a4f0 100644
--- a/test/type_inference/init.lua
+++ b/test/type_inference/init.lua
@@ -1065,3 +1065,22 @@ function F(<?x?>) end
---@param x boolean
function F(x) end
]]
+
+TEST 'B' [[
+---@class A
+local A
+
+---@return A
+function A:x() end
+
+---@class B: A
+local B
+
+---@return B
+function B:x() end
+
+---@type B
+local t
+
+local <!<?v?>!> = t.x()
+]]