diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2021-03-27 17:39:08 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2021-03-27 17:39:08 +0800 |
commit | aa669fd32b51f338dfc76e8efd40ade98431537b (patch) | |
tree | 0de8afeef767e590572d72fe0f5557f974e349e3 | |
parent | f7e6d4f875f0733e7a61dfb767ed5acfc007fe69 (diff) | |
download | lua-language-server-aa669fd32b51f338dfc76e8efd40ade98431537b.zip |
fix #468
-rw-r--r-- | changelog.md | 3 | ||||
-rw-r--r-- | script/core/hover/description.lua | 3 | ||||
-rw-r--r-- | test/crossfile/hover.lua | 32 |
3 files changed, 38 insertions, 0 deletions
diff --git a/changelog.md b/changelog.md index d82b97b9..6ccdb225 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,8 @@ # changelog +## 1.20.1 +* `FIX` [#468](https://github.com/sumneko/lua-language-server/issues/468) + ## 1.20.0 `2021-3-27` * `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) diff --git a/script/core/hover/description.lua b/script/core/hover/description.lua index d081aa7f..3766d2f4 100644 --- a/script/core/hover/description.lua +++ b/script/core/hover/description.lua @@ -358,6 +358,9 @@ return function (source) if source.type == 'string' then return asString(source) end + if source.type == 'field' then + source = source.parent + end return tryDocOverloadToComment(source) or tryDocFieldUpComment(source) or tyrDocParamComment(source) diff --git a/test/crossfile/hover.lua b/test/crossfile/hover.lua index b72a6391..d0080ed9 100644 --- a/test/crossfile/hover.lua +++ b/test/crossfile/hover.lua @@ -684,3 +684,35 @@ hover = { name = 'x', description = 'BBB' }} + +TEST {{ path = 'a.lua', content = '', }, { + path = 'b.lua', + content = [[ +---AAA +G.<?A?> = 1 + +---BBB +G.A = 1 + ]] +}, +hover = { + label = 'global G.A: integer = 1', + name = 'G.A', + description = 'AAA' +}} + +TEST {{ path = 'a.lua', content = '', }, { + path = 'b.lua', + content = [[ +---AAA +G.A = 1 + +---BBB +G.<?A?> = 1 + ]] +}, +hover = { + label = 'global G.A: integer = 1', + name = 'G.A', + description = 'BBB' +}} |