summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authoractboy168 <actboy168@gmail.com>2020-12-03 14:15:41 +0800
committeractboy168 <actboy168@gmail.com>2020-12-03 14:15:41 +0800
commitd481a5a6a103a057830d62a5d4afa04f0cab3a1e (patch)
tree19476dc413a58e49e55b9c3fe36d5f8ada299957 /test
parentc08d501b7bdea16d87998d3ef28c2b708515cd10 (diff)
downloadlua-language-server-d481a5a6a103a057830d62a5d4afa04f0cab3a1e.zip
增加若干测试
Diffstat (limited to 'test')
-rw-r--r--test/crossfile/hover.lua111
1 files changed, 96 insertions, 15 deletions
diff --git a/test/crossfile/hover.lua b/test/crossfile/hover.lua
index 3715ba9c..9fc0842e 100644
--- a/test/crossfile/hover.lua
+++ b/test/crossfile/hover.lua
@@ -485,23 +485,104 @@ function f(x: string, y: table)
}
}
-TEST {
- {
- path = 'a.lua',
- content = '',
- },
- {
- path = 'b.lua',
- content = [[
+TEST {{ path = 'a.lua', content = '', }, {
+ path = 'b.lua',
+ content = [[
---Comment
---@param x string
---@return string # this is comment
function f(<?x?>) end
]]
- },
- hover = {
- label = [[local x: string]],
- name = 'x',
- description = nil,
- }
-}
+},
+hover = {
+ label = [[local x: string]],
+ name = 'x',
+ description = nil,
+}}
+
+
+TEST {{ path = 'a.lua', content = '', }, {
+ path = 'b.lua',
+ content = [[
+ ---comment1
+ ---@param arg1 integer
+ ---@param arg2 integer comment2
+ ---@return boolean
+ ---comment3
+ function <?f?>(arg1, arg2) end
+ ]]
+},
+hover = {
+ label = [[
+function f(arg1: integer, arg2: integer)
+ -> boolean]],
+ name = 'f',
+ description = [[
+---
+
+comment1
+
+@*param* `arg2` — comment2
+
+comment3]]
+}}
+
+
+TEST {{ path = 'a.lua', content = '', }, {
+ path = 'b.lua',
+ content = [[
+ ---@return boolean, string #comment
+ function <?f?>() end
+ ]]
+},
+hover = {
+ label = [[
+function f()
+ -> boolean
+ 2. string]],
+ name = 'f',
+ description = [[
+---
+
+@*return* — comment]]
+}}
+
+TEST {{ path = 'a.lua', content = '', }, {
+ path = 'b.lua',
+ content = [[
+ ---@return boolean
+ ---@return string #comment
+ function <?f?>() end
+ ]]
+},
+hover = {
+ label = [[
+function f()
+ -> boolean
+ 2. string]],
+ name = 'f',
+ description = [[
+---
+
+@*return*
+
+@*return* — comment]]
+}}
+
+
+TEST {{ path = 'a.lua', content = '', }, {
+ path = 'b.lua',
+ content = [[
+ ---@return boolean
+ ---@return string
+ function <?f?>() end
+ ]]
+},
+hover = {
+ label = [[
+function f()
+ -> boolean
+ 2. string]],
+ name = 'f',
+ description = nil
+}}