diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-04-07 02:14:49 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-04-07 02:14:49 +0800 |
commit | 3e2948e1480659d7c29f9d701e378330c08b238f (patch) | |
tree | 897356bf814adf07642409741b1b55f5cb02a3f2 /test | |
parent | 55b423dbeabb6f04dc5429b362c7cb1f770dac93 (diff) | |
download | lua-language-server-3e2948e1480659d7c29f9d701e378330c08b238f.zip |
update
Diffstat (limited to 'test')
-rw-r--r-- | test/crossfile/hover.lua | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/test/crossfile/hover.lua b/test/crossfile/hover.lua index cb9e83aa..b5c599eb 100644 --- a/test/crossfile/hover.lua +++ b/test/crossfile/hover.lua @@ -44,7 +44,7 @@ function TEST(expect) local script, list = catch(file.content, '?') local uri = furi.encode(file.path) files.setText(uri, script) - if list['?'] then + if #list['?'] > 0 then sourceUri = uri sourcePos = (list['?'][1][1] + list['?'][1][2]) // 2 end @@ -280,7 +280,7 @@ TEST { hover = [[ ```lua global t: { - [1]: integer = 2, + [1]: integer = 1|2, } ```]], } @@ -362,22 +362,22 @@ TEST { path = 'b.lua', content = [[ ---@param x string - ---| "'选项1'" # 注释1 - ---| > "'选项2'" # 注释2 + ---| "选项1" # 注释1 + ---| > "选项2" # 注释2 function <?f?>(x) end ]] }, hover = [[ ```lua -function f(x: string|'选项1'|'选项2') +function f(x: string|"选项1"|"选项2") ``` --- ```lua -x: string - | '选项1' -- 注释1 - -> '选项2' -- 注释2 +x: + | "选项1" -- 注释1 + -> "选项2" -- 注释2 ```]] } @@ -390,23 +390,23 @@ TEST { path = 'b.lua', content = [[ ---@alias option - ---| "'选项1'" # 注释1 - ---| > "'选项2'" # 注释2 + ---| "选项1" # 注释1 + ---| > "选项2" # 注释2 ---@param x option function <?f?>(x) end ]] }, hover = [[ ```lua -function f(x: '选项1'|'选项2') +function f(x: "选项1"|"选项2") ``` --- ```lua -x: option - | '选项1' -- 注释1 - -> '选项2' -- 注释2 +x: + | "选项1" -- 注释1 + -> "选项2" -- 注释2 ```]] } @@ -419,8 +419,8 @@ TEST { path = 'b.lua', content = [[ ---@alias option - ---| "'选项1'" # 注释1 - ---| > "'选项2'" # 注释2 + ---| "选项1" # 注释1 + ---| > "选项2" # 注释2 ---@return option x function <?f?>() end ]] @@ -428,15 +428,15 @@ TEST { hover = [[ ```lua function f() - -> x: '选项1'|'选项2' + -> x: "选项1"|"选项2" ``` --- ```lua -x: option - | '选项1' -- 注释1 - -> '选项2' -- 注释2 +x: + | "选项1" -- 注释1 + -> "选项2" -- 注释2 ```]] } @@ -449,8 +449,8 @@ TEST { path = 'b.lua', content = [[ ---@alias option - ---| "'选项1'" # 注释1 - ---| > "'选项2'" # 注释2 + ---| "选项1" # 注释1 + ---| > "选项2" # 注释2 ---@return option function <?f?>() end ]] @@ -458,15 +458,15 @@ TEST { hover = [[ ```lua function f() - -> '选项1'|'选项2' + -> "选项1"|"选项2" ``` --- ```lua -return #1: option - | '选项1' -- 注释1 - -> '选项2' -- 注释2 +return #1: + | "选项1" -- 注释1 + -> "选项2" -- 注释2 ```]] } |