summaryrefslogtreecommitdiff
path: root/test/crossfile/hover.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/crossfile/hover.lua')
-rw-r--r--test/crossfile/hover.lua57
1 files changed, 57 insertions, 0 deletions
diff --git a/test/crossfile/hover.lua b/test/crossfile/hover.lua
index d013af98..a18c714b 100644
--- a/test/crossfile/hover.lua
+++ b/test/crossfile/hover.lua
@@ -1637,6 +1637,30 @@ TEST {
{
path = 'a.lua',
content = [[
+ ---@enum(key) <?A?>
+ local t = {
+ x = 1 << 0,
+ y = 1 << 1,
+ z = 1 << 2,
+ }
+ ]]
+ },
+ hover = [[
+```lua
+(enum) A
+```
+
+---
+
+```lua
+"x" | "y" | "z"
+```]]
+}
+
+TEST {
+ {
+ path = 'a.lua',
+ content = [[
---@alias someType
---| "#" # description
@@ -1695,6 +1719,26 @@ function f(x: number, y: number)
```]]
}
+TEST { { path = 'a.lua', content = [[
+---@overload fun(self: self, x: number)
+---@overload fun(self: self, x: number, y: number)
+function M:f(...)
+end
+
+M:<?f?>
+]] },
+hover = [[
+```lua
+(method) M:f(x: number)
+```
+
+---
+
+```lua
+(method) M:f(x: number, y: number)
+```]]
+}
+
TEST { {path = 'a.lua', content = [[
---@class A
@@ -1795,3 +1839,16 @@ local x: integer = 1
comment1]]
}
+
+TEST { {path = 'a.lua', content = [[
+local t = {}
+
+print(<?t?>['a b'])
+]]},
+hover = [[
+```lua
+local t: {
+ ['a b']: unknown,
+}
+```]]
+}