From bc3976210d46fc7187a00930b6761abad60cc967 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Fri, 8 Oct 2021 19:08:39 +0800 Subject: fix #706 --- changelog.md | 1 + script/provider/markdown.lua | 3 --- test/crossfile/hover.lua | 19 +++++++++++++++++++ 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/changelog.md b/changelog.md index 5b58f21b..30dabd47 100644 --- a/changelog.md +++ b/changelog.md @@ -1,6 +1,7 @@ # changelog ## 2.4.2 +* `FIX` [#706](https://github.com/sumneko/lua-language-server/issues/706) * `FIX` [#707](https://github.com/sumneko/lua-language-server/issues/707) * `FIX` [#709](https://github.com/sumneko/lua-language-server/issues/709) diff --git a/script/provider/markdown.lua b/script/provider/markdown.lua index 3a215f0f..213c417d 100644 --- a/script/provider/markdown.lua +++ b/script/provider/markdown.lua @@ -23,9 +23,6 @@ function mt:add(language, text) } else text = tostring(text) - if #text == 0 then - return - end self[#self+1] = { type = 'text', language = language, diff --git a/test/crossfile/hover.lua b/test/crossfile/hover.lua index 13e5e5c0..b1c4c804 100644 --- a/test/crossfile/hover.lua +++ b/test/crossfile/hover.lua @@ -999,3 +999,22 @@ local x: number --- aaa]]} + +TEST {{ path = 'a.lua', content = '', }, { + path = 'b.lua', + content = [[ +---line1 +--- +---line2 +local function () end +]] +}, +hover = [[ +```lua +function fn() +``` + +--- +line1 + +line2]]} -- cgit v1.2.3