summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2021-01-05 11:47:27 +0800
committer最萌小汐 <sumneko@hotmail.com>2021-01-05 11:47:27 +0800
commite39fba474ab432265c9af4a66e2a1764cd0ca1d3 (patch)
tree8a87de2a2d09ea2bebc4e5d1ce6a947a480202c3
parente6e7a510cc8a34be73c82d26f7313af5fc187748 (diff)
downloadlua-language-server-e39fba474ab432265c9af4a66e2a1764cd0ca1d3.zip
hover: tail comments may be cutted
-rw-r--r--changelog.md2
-rw-r--r--script/core/hover/description.lua6
-rw-r--r--test/hover/init.lua7
3 files changed, 14 insertions, 1 deletions
diff --git a/changelog.md b/changelog.md
index 8f5a3bdf..b519d3f5 100644
--- a/changelog.md
+++ b/changelog.md
@@ -1,6 +1,8 @@
# changelog
## 1.11.0
+* `CHG` completion: improve performance of workspace words
+* `FIX` hover: tail comments may be cutted
* `FIX` runtime errors
## 1.10.0
diff --git a/script/core/hover/description.lua b/script/core/hover/description.lua
index 570dec3f..cd24b013 100644
--- a/script/core/hover/description.lua
+++ b/script/core/hover/description.lua
@@ -94,7 +94,11 @@ local function getBindComment(source, docGroup, base)
continue = true
lines = {}
end
- lines[#lines+1] = doc.comment.text:sub(2)
+ if doc.comment.text:sub(1, 1) == '-' then
+ lines[#lines+1] = doc.comment.text:sub(2)
+ else
+ lines[#lines+1] = doc.comment.text
+ end
elseif doc == base then
break
else
diff --git a/test/hover/init.lua b/test/hover/init.lua
index 5b3acded..832ce50c 100644
--- a/test/hover/init.lua
+++ b/test/hover/init.lua
@@ -1510,3 +1510,10 @@ local v: C {
x: string,
}
]]
+
+TEST [[
+local <?x?>--测试
+]]
+[[
+local x: any
+]]