summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-02-22 17:50:36 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-02-22 17:50:36 +0800
commit063c5df95d74c8ba53dc5c38de9b57be30a3ef07 (patch)
tree19addea2dd376dafdf24c8eac9376a14b79a2363 /test
parentc8b027715e2e39fdeebbb115a25fb8f052d97722 (diff)
downloadlua-language-server-063c5df95d74c8ba53dc5c38de9b57be30a3ef07.zip
fix #403 improve class hover
Diffstat (limited to 'test')
-rw-r--r--test/completion/init.lua1
-rw-r--r--test/crossfile/hover.lua59
2 files changed, 54 insertions, 6 deletions
diff --git a/test/completion/init.lua b/test/completion/init.lua
index 7db54f2f..fc9233d8 100644
--- a/test/completion/init.lua
+++ b/test/completion/init.lua
@@ -1784,7 +1784,6 @@ zz$
global zzz: integer = 1
```
---
-
abc]],
}
}
diff --git a/test/crossfile/hover.lua b/test/crossfile/hover.lua
index 5995f1bd..d81a46a4 100644
--- a/test/crossfile/hover.lua
+++ b/test/crossfile/hover.lua
@@ -308,10 +308,7 @@ TEST {
hover = {
label = [[global x: integer = 1]],
name = 'x',
- description = [[
----
-
- abc]],
+ description = ' abc',
}
}
@@ -627,7 +624,7 @@ TEST {{ path = 'a.lua', content = '', }, {
hover = {
label = "function f(a: boolean|true|false)",
name = 'f',
- description = [[
+ description = [[
@*param* `a` — xxx
```lua
a: boolean
@@ -635,3 +632,55 @@ a: boolean
| false -- fff
```]]
}}
+
+TEST {{ path = 'a.lua', content = '', }, {
+ path = 'b.lua',
+ content = [[
+---AAA
+---@class A
+
+---@type A
+local <?x?>
+ ]]
+},
+hover = {
+ label = 'local x: A',
+ name = 'x',
+ description = 'AAA'
+}}
+
+TEST {{ path = 'a.lua', content = '', }, {
+ path = 'b.lua',
+ content = [[
+---AAA
+---@class A
+---BBB
+---@field n string
+local <?x?>
+ ]]
+},
+hover = {
+ label = [[
+local x: A {
+ n: string,
+}]],
+ name = 'x',
+ description = 'AAA'
+}}
+
+TEST {{ path = 'a.lua', content = '', }, {
+ path = 'b.lua',
+ content = [[
+---AAA
+---@class A
+
+---BBB
+---@type A
+local <?x?>
+ ]]
+},
+hover = {
+ label = 'local x: A',
+ name = 'x',
+ description = 'BBB'
+}}