summaryrefslogtreecommitdiff
path: root/test/hover
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-10-24 20:17:04 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-10-24 20:17:04 +0800
commitb53089f637e5f4e77f2cfd938f254dc983bb5fb4 (patch)
tree838b267e8b442e09861d0e1fffb695f68feec2da /test/hover
parent5e41989b246954c44d377c96572046be339fea18 (diff)
downloadlua-language-server-b53089f637e5f4e77f2cfd938f254dc983bb5fb4.zip
supports `private`, `protected` and `public`
#1316
Diffstat (limited to 'test/hover')
-rw-r--r--test/hover/init.lua135
1 files changed, 135 insertions, 0 deletions
diff --git a/test/hover/init.lua b/test/hover/init.lua
index c9e1ecdb..47204e3a 100644
--- a/test/hover/init.lua
+++ b/test/hover/init.lua
@@ -2145,3 +2145,138 @@ local function <?f?>(
)
end
]]
+
+TEST [[
+---@class A
+---@field private x number
+---@field y number
+local <?t?>
+]]
+[[
+local t: A {
+ x: number,
+ y: number,
+}
+]]
+
+TEST [[
+---@class A
+---@field private x number
+---@field y number
+
+---@type A
+local <?t?>
+]]
+[[
+local t: A {
+ y: number,
+}
+]]
+
+TEST [[
+---@class A
+---@field private x number
+---@field y number
+<?t?> = {}
+]]
+[[
+(global) t: A {
+ x: number,
+ y: number,
+}
+]]
+
+TEST [[
+---@class A
+---@field private x number
+---@field y number
+
+---@type A
+<?t?> = {}
+]]
+[[
+(global) t: A {
+ y: number,
+}
+]]
+
+TEST [[
+---@class A
+---@field private x number
+---@field y number
+
+---@type A
+v.<?t?> = {}
+]]
+[[
+(global) v.t: A {
+ y: number,
+}
+]]
+
+TEST [[
+---@class A
+---@field private x number
+---@field protected y number
+---@field z number
+
+---@type A
+local <?t?>
+]]
+[[
+local t: A {
+ z: number,
+}
+]]
+
+TEST [[
+---@class A
+---@field private x number
+---@field protected y number
+---@field z number
+
+---@class B: A
+local <?t?>
+]]
+[[
+local t: B {
+ y: number,
+ z: number,
+}
+]]
+
+TEST [[
+---@class A
+---@field private x number
+---@field protected y number
+---@field z number
+
+---@class B: A
+---@field private a number
+local <?t?>
+]]
+[[
+local t: B {
+ a: number,
+ y: number,
+ z: number,
+}
+]]
+
+TEST [[
+---@class A
+---@field private x number
+---@field protected y number
+---@field z number
+
+---@class B: A
+---@field private a number
+
+---@type B
+local <?t?>
+]]
+[[
+local t: B {
+ z: number,
+}
+]]