diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2020-11-11 15:44:12 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2020-11-11 15:44:12 +0800 |
commit | 16ed5b65e4b52933942b947fb9a5ddfd5513c3f1 (patch) | |
tree | da265648124fd6d107ed24ff4c7acba930be2295 /test-beta/crossfile/hover.lua | |
parent | 4593b4732553b777b97726f7deb4d0b842f26909 (diff) | |
download | lua-language-server-16ed5b65e4b52933942b947fb9a5ddfd5513c3f1.zip |
函数查看resume
Diffstat (limited to 'test-beta/crossfile/hover.lua')
-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 { { |