summaryrefslogtreecommitdiff
path: root/script-beta
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2020-11-12 17:42:10 +0800
committer最萌小汐 <sumneko@hotmail.com>2020-11-12 17:42:10 +0800
commitf1362652b7c45f05690369f2c9d3ef3d38ab2f7f (patch)
tree853e6dd719a775c39425b4012bc382aac0f0e795 /script-beta
parent939092780936b0ca070d8ea6c6b49565ad43a25a (diff)
downloadlua-language-server-f1362652b7c45f05690369f2c9d3ef3d38ab2f7f.zip
暂存
Diffstat (limited to 'script-beta')
-rw-r--r--script-beta/core/completion.lua13
-rw-r--r--script-beta/core/hover/description.lua6
2 files changed, 16 insertions, 3 deletions
diff --git a/script-beta/core/completion.lua b/script-beta/core/completion.lua
index a959a8c9..ac4ef57c 100644
--- a/script-beta/core/completion.lua
+++ b/script-beta/core/completion.lua
@@ -1028,7 +1028,18 @@ end
local function tryLuaDocCate(line, results)
local word = line:sub(3)
- for _, docType in ipairs {'class', 'type', 'alias', 'param', 'return', 'field', 'generic', 'vararg', 'overload'} do
+ for _, docType in ipairs {
+ 'class',
+ 'type',
+ 'alias',
+ 'param',
+ 'return',
+ 'field',
+ 'generic',
+ 'vararg',
+ 'overload',
+ 'deprecated'
+ } do
if matchKey(word, docType) then
results[#results+1] = {
label = docType,
diff --git a/script-beta/core/hover/description.lua b/script-beta/core/hover/description.lua
index 3f39d959..8192beec 100644
--- a/script-beta/core/hover/description.lua
+++ b/script-beta/core/hover/description.lua
@@ -218,12 +218,14 @@ end
local function getBindEnums(source)
local chunks = {}
+ local returnIndex = 0
for _, doc in ipairs(source.bindDocs) do
if doc.type == 'doc.param' then
chunks[#chunks+1] = buildEnumChunk(doc.extends, doc.param[1])
elseif doc.type == 'doc.return' then
- for n, rtn in ipairs(doc.returns) do
- chunks[#chunks+1] = buildEnumChunk(rtn, rtn.name and rtn.name[1] or ('(return %d)'):format(n))
+ for _, rtn in ipairs(doc.returns) do
+ returnIndex = returnIndex + 1
+ chunks[#chunks+1] = buildEnumChunk(rtn, rtn.name and rtn.name[1] or ('(return %d)'):format(returnIndex))
end
end
end