diff options
Diffstat (limited to 'test-beta')
-rw-r--r-- | test-beta/crossfile/hover.lua | 63 |
1 files changed, 61 insertions, 2 deletions
diff --git a/test-beta/crossfile/hover.lua b/test-beta/crossfile/hover.lua index 5e915803..fd11481d 100644 --- a/test-beta/crossfile/hover.lua +++ b/test-beta/crossfile/hover.lua @@ -319,7 +319,7 @@ x: string ```]] } } -do return end + TEST { { path = 'a.lua', @@ -336,7 +336,36 @@ TEST { ]] }, hover = { - label = 'function f(x: option)', + label = "function f(x: '选项1'|'选项2')", + name = 'f', + description = [[ +```lua +x: option + | '选项1' -- 注释1 + |>'选项2' -- 注释2 +```]] + } +} + +TEST { + { + path = 'a.lua', + content = '', + }, + { + path = 'b.lua', + content = [[ + ---@alias option + ---| "'选项1'" # 注释1 + ---| > "'选项2'" # 注释2 + ---@return option x + function <?f?>() end + ]] + }, + hover = { + label = [[ +function f() + -> x: '选项1'|'选项2']], name = 'f', description = [[ ```lua @@ -346,6 +375,36 @@ x: option ```]] } } + +TEST { + { + path = 'a.lua', + content = '', + }, + { + path = 'b.lua', + content = [[ + ---@alias option + ---| "'选项1'" # 注释1 + ---| > "'选项2'" # 注释2 + ---@return option + function <?f?>() end + ]] + }, + hover = { + label = [[ +function f() + -> '选项1'|'选项2']], + name = 'f', + description = [[ +```lua +(return 1): option + | '选项1' -- 注释1 + |>'选项2' -- 注释2 +```]] + } +} + do return end TEST { { |