summaryrefslogtreecommitdiff
path: root/test/definition
diff options
context:
space:
mode:
authoruhziel <uhziel@gmail.com>2020-12-24 20:04:23 +0800
committerGitHub <noreply@github.com>2020-12-24 20:04:23 +0800
commit01688aa0248388feb0fbd0c618f2f02bc3a5de96 (patch)
tree88defe2e8d8ea8dc80bf29c9955507fe5d16bc43 /test/definition
parent0161e51df7f8aed8406e964316eb98926a52c023 (diff)
parent49226612d1b557401a486df3e65fc138bec62d63 (diff)
downloadlua-language-server-01688aa0248388feb0fbd0c618f2f02bc3a5de96.zip
Merge branch 'master' into generic-name-string-literal
Diffstat (limited to 'test/definition')
-rw-r--r--test/definition/bug.lua23
-rw-r--r--test/definition/luadoc.lua28
2 files changed, 51 insertions, 0 deletions
diff --git a/test/definition/bug.lua b/test/definition/bug.lua
index e7158848..8c446123 100644
--- a/test/definition/bug.lua
+++ b/test/definition/bug.lua
@@ -146,3 +146,26 @@ t.<!f1!> = t.f2
print(t.<?f2?>)
]]
+
+TEST [[
+---@type string
+string.xx = ''
+string.xx:<?format?>()
+]]
+
+TEST [[
+---@class Foo
+Foo = {}
+function Foo:Constructor()
+ self.<!bar1!> = 1
+end
+
+---@class Foo2: Foo
+Foo2 = {}
+function Foo2:Constructor()
+end
+
+---@type Foo2
+local v
+v.<?bar1?>
+]]
diff --git a/test/definition/luadoc.lua b/test/definition/luadoc.lua
index 31134135..4a23b2ac 100644
--- a/test/definition/luadoc.lua
+++ b/test/definition/luadoc.lua
@@ -169,3 +169,31 @@ end
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!>?>
+]]