diff options
-rw-r--r-- | changelog.md | 2 | ||||
-rw-r--r-- | script/core/hover/label.lua | 3 | ||||
-rw-r--r-- | test/hover/init.lua | 14 |
3 files changed, 16 insertions, 3 deletions
diff --git a/changelog.md b/changelog.md index 8508c366..b10c738e 100644 --- a/changelog.md +++ b/changelog.md @@ -158,6 +158,7 @@ server will generate `doc.json` and `doc.md` in `LOGPATH`. * `FIX` [#1640] * `FIX` [#1642] * `FIX` [#1662] +* `FIX` [#1672] [#1153]: https://github.com/sumneko/lua-language-server/issues/1153 [#1177]: https://github.com/sumneko/lua-language-server/issues/1177 @@ -191,6 +192,7 @@ server will generate `doc.json` and `doc.md` in `LOGPATH`. [#1662]: https://github.com/sumneko/lua-language-server/issues/1662 [#1663]: https://github.com/sumneko/lua-language-server/issues/1663 [#1670]: https://github.com/sumneko/lua-language-server/issues/1670 +[#1672]: https://github.com/sumneko/lua-language-server/issues/1672 ## 3.5.6 `2022-9-16` diff --git a/script/core/hover/label.lua b/script/core/hover/label.lua index 5c502ec1..6ce4dde9 100644 --- a/script/core/hover/label.lua +++ b/script/core/hover/label.lua @@ -58,8 +58,7 @@ local function asValue(source, title) and ( type == 'table' or type == 'any' or type == 'unknown' - or type == 'nil' - or type:sub(1, 1) == '{') then + or type == 'nil') then else pack[#pack+1] = type end diff --git a/test/hover/init.lua b/test/hover/init.lua index 974f87db..4ce2de8c 100644 --- a/test/hover/init.lua +++ b/test/hover/init.lua @@ -1668,7 +1668,7 @@ TEST [[ local <?t?> ]] [[ -local t: { +local t: { x: string, y: number, z: boolean } { x: string, y: number, z: boolean, @@ -2403,3 +2403,15 @@ TEST [[ [[ (field) A.x: number ]] + +TEST [[ +---@type { [string]: string }[] +local t + +print(<?t?>.foo) +]] +[[ +local t: { [string]: string }[] { + foo: unknown, +} +]] |