summaryrefslogtreecommitdiff
path: root/test-beta
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2020-11-02 10:50:58 +0800
committer最萌小汐 <sumneko@hotmail.com>2020-11-02 10:50:58 +0800
commit2ca7cad6ead1b12cd899dd7ecac6b8442f499046 (patch)
tree54fc3b37dabec086697620e0d456c279cfbe4c98 /test-beta
parent9af004f6987221ea92f77118c18996d8d43ee672 (diff)
downloadlua-language-server-2ca7cad6ead1b12cd899dd7ecac6b8442f499046.zip
alias 的 hover
Diffstat (limited to 'test-beta')
-rw-r--r--test-beta/definition/luadoc.lua6
-rw-r--r--test-beta/hover/init.lua26
2 files changed, 32 insertions, 0 deletions
diff --git a/test-beta/definition/luadoc.lua b/test-beta/definition/luadoc.lua
index 675495ef..41331c48 100644
--- a/test-beta/definition/luadoc.lua
+++ b/test-beta/definition/luadoc.lua
@@ -121,6 +121,12 @@ local mt = {}
mt.<?name?>
]]
+TEST [[
+---@alias <!A!> string
+
+---@type <?A?>
+]]
+
-- TODO
do return end
TEST [[
diff --git a/test-beta/hover/init.lua b/test-beta/hover/init.lua
index 43a81fa3..420e4c1d 100644
--- a/test-beta/hover/init.lua
+++ b/test-beta/hover/init.lua
@@ -1257,3 +1257,29 @@ local t: Class {
z: string,
}
]]
+
+TEST [[
+---@class A
+
+---@type <?A?>
+]]
+[[
+class A
+]]
+
+TEST [[
+---@type string | "'enum1'" | "'enum2'"
+local <?t?>
+]]
+[[
+local t: string|'enum1'|'enum2'
+]]
+
+TEST [[
+---@alias A string | "'enum1'" | "'enum2'"
+
+---@type <?A?>
+]]
+[[
+展开为 string|'enum1'|'enum2'
+]]