diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2021-02-22 17:50:36 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2021-02-22 17:50:36 +0800 |
commit | 063c5df95d74c8ba53dc5c38de9b57be30a3ef07 (patch) | |
tree | 19addea2dd376dafdf24c8eac9376a14b79a2363 /test | |
parent | c8b027715e2e39fdeebbb115a25fb8f052d97722 (diff) | |
download | lua-language-server-063c5df95d74c8ba53dc5c38de9b57be30a3ef07.zip |
fix #403 improve class hover
Diffstat (limited to 'test')
-rw-r--r-- | test/completion/init.lua | 1 | ||||
-rw-r--r-- | test/crossfile/hover.lua | 59 |
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' +}} |