diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-07-15 17:11:11 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-07-15 17:11:11 +0800 |
commit | ac3235f4e9b800b0726a2e90555b109d5b58abfb (patch) | |
tree | dcf79c70ef825c7ac9462a93c86a782907a6c834 /test | |
parent | 59b2b8eb9d0eadd5de1eabf366d8b99b63660719 (diff) | |
download | lua-language-server-ac3235f4e9b800b0726a2e90555b109d5b58abfb.zip |
fix hover
Diffstat (limited to 'test')
-rw-r--r-- | test/crossfile/hover.lua | 22 | ||||
-rw-r--r-- | test/hover/init.lua | 8 |
2 files changed, 30 insertions, 0 deletions
diff --git a/test/crossfile/hover.lua b/test/crossfile/hover.lua index 3c62b8f8..84276a27 100644 --- a/test/crossfile/hover.lua +++ b/test/crossfile/hover.lua @@ -1360,3 +1360,25 @@ local n: unknown --- [here](command:xxxxx)]] } + +TEST { + { + path = 'a.lua', + content = [[ + ---@class A + ---@field x number # comments + + ---@type A + local t + + print(t.<?x?>) + ]] + }, + hover = [[ +```lua +(field) A.x: number +``` + +--- + comments]] +} diff --git a/test/hover/init.lua b/test/hover/init.lua index 82cf1ddf..0954ac80 100644 --- a/test/hover/init.lua +++ b/test/hover/init.lua @@ -2112,3 +2112,11 @@ print(<?bool?>) [[ local bool: boolean = true|false ]] + +TEST [[ +---@type 'a' +local <?s?> +]] +[[ +local s: 'a' +]] |