Skip to content

Commit aa669fd

Browse files
committed
fix #468
1 parent f7e6d4f commit aa669fd

File tree

3 files changed

+38
-0
lines changed

3 files changed

+38
-0
lines changed

changelog.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# changelog
22

3+
## 1.20.1
4+
* `FIX` [#468](https://github.com./sumneko/lua-language-server/issues/468)
5+
36
## 1.20.0
47
`2021-3-27`
58
* `CHG` telemetry: change to opt-in, see [#462](https://github.com./sumneko/lua-language-server/issues/462) and [Privacy-Policy](https://github.com./sumneko/lua-language-server/wiki/Privacy-Policy)

script/core/hover/description.lua

+3
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,9 @@ return function (source)
358358
if source.type == 'string' then
359359
return asString(source)
360360
end
361+
if source.type == 'field' then
362+
source = source.parent
363+
end
361364
return tryDocOverloadToComment(source)
362365
or tryDocFieldUpComment(source)
363366
or tyrDocParamComment(source)

test/crossfile/hover.lua

+32
Original file line numberDiff line numberDiff line change
@@ -684,3 +684,35 @@ hover = {
684684
name = 'x',
685685
description = 'BBB'
686686
}}
687+
688+
TEST {{ path = 'a.lua', content = '', }, {
689+
path = 'b.lua',
690+
content = [[
691+
---AAA
692+
G.<?A?> = 1
693+
694+
---BBB
695+
G.A = 1
696+
]]
697+
},
698+
hover = {
699+
label = 'global G.A: integer = 1',
700+
name = 'G.A',
701+
description = 'AAA'
702+
}}
703+
704+
TEST {{ path = 'a.lua', content = '', }, {
705+
path = 'b.lua',
706+
content = [[
707+
---AAA
708+
G.A = 1
709+
710+
---BBB
711+
G.<?A?> = 1
712+
]]
713+
},
714+
hover = {
715+
label = 'global G.A: integer = 1',
716+
name = 'G.A',
717+
description = 'BBB'
718+
}}

0 commit comments

Comments
 (0)