Skip to content

Commit 8ed72a9

Browse files
committed
fix #1672
1 parent 6176475 commit 8ed72a9

File tree

3 files changed

+16
-3
lines changed

3 files changed

+16
-3
lines changed

changelog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ server will generate `doc.json` and `doc.md` in `LOGPATH`.
158158
* `FIX` [#1640]
159159
* `FIX` [#1642]
160160
* `FIX` [#1662]
161+
* `FIX` [#1672]
161162

162163
[#1153]: https://github.com/sumneko/lua-language-server/issues/1153
163164
[#1177]: https://github.com/sumneko/lua-language-server/issues/1177
@@ -191,6 +192,7 @@ server will generate `doc.json` and `doc.md` in `LOGPATH`.
191192
[#1662]: https://github.com/sumneko/lua-language-server/issues/1662
192193
[#1663]: https://github.com/sumneko/lua-language-server/issues/1663
193194
[#1670]: https://github.com/sumneko/lua-language-server/issues/1670
195+
[#1672]: https://github.com/sumneko/lua-language-server/issues/1672
194196

195197
## 3.5.6
196198
`2022-9-16`

script/core/hover/label.lua

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,7 @@ local function asValue(source, title)
5858
and ( type == 'table'
5959
or type == 'any'
6060
or type == 'unknown'
61-
or type == 'nil'
62-
or type:sub(1, 1) == '{') then
61+
or type == 'nil') then
6362
else
6463
pack[#pack+1] = type
6564
end

test/hover/init.lua

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1668,7 +1668,7 @@ TEST [[
16681668
local <?t?>
16691669
]]
16701670
[[
1671-
local t: {
1671+
local t: { x: string, y: number, z: boolean } {
16721672
x: string,
16731673
y: number,
16741674
z: boolean,
@@ -2403,3 +2403,15 @@ TEST [[
24032403
[[
24042404
(field) A.x: number
24052405
]]
2406+
2407+
TEST [[
2408+
---@type { [string]: string }[]
2409+
local t
2410+
2411+
print(<?t?>.foo)
2412+
]]
2413+
[[
2414+
local t: { [string]: string }[] {
2415+
foo: unknown,
2416+
}
2417+
]]

0 commit comments

Comments
 (0)