summaryrefslogtreecommitdiff
path: root/script/core/hover
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-03-30 02:42:02 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-03-30 02:42:02 +0800
commit635b266a9188cf87ae856a21308347c113c52250 (patch)
tree76e9d80067b2b602f0b686cf25f655a3da871f09 /script/core/hover
parentbaa04101dfe6ce82046ec53eb7b52cedb02876ba (diff)
downloadlua-language-server-635b266a9188cf87ae856a21308347c113c52250.zip
update
Diffstat (limited to 'script/core/hover')
-rw-r--r--script/core/hover/arg.lua6
-rw-r--r--script/core/hover/return.lua3
2 files changed, 5 insertions, 4 deletions
diff --git a/script/core/hover/arg.lua b/script/core/hover/arg.lua
index c2c6a105..c9c81a85 100644
--- a/script/core/hover/arg.lua
+++ b/script/core/hover/arg.lua
@@ -34,15 +34,15 @@ local function asFunction(source, oop)
args[#args+1] = ('%s%s: %s'):format(
name,
optionalArg(arg) and '?' or '',
- infer.viewType(arg)
+ infer.viewType(arg, 'any')
)
elseif arg.type == '...' then
args[#args+1] = ('%s: %s'):format(
'...',
- infer.viewType(arg)
+ infer.viewType(arg, 'any')
)
else
- args[#args+1] = ('%s'):format(infer.viewType(arg))
+ args[#args+1] = ('%s'):format(infer.viewType(arg, 'any'))
end
::CONTINUE::
end
diff --git a/script/core/hover/return.lua b/script/core/hover/return.lua
index f34f364e..e48febf3 100644
--- a/script/core/hover/return.lua
+++ b/script/core/hover/return.lua
@@ -64,8 +64,9 @@ local function asFunction(source)
for i = 1, num do
local rtn = compiler.getReturnOfFunction(source, i)
local doc = docs[i]
+ local name = doc and doc.name and doc.name[1] and (doc.name[1] .. ': ')
local text = ('%s%s%s'):format(
- doc and doc.name[1] or '',
+ name or '',
infer.viewType(rtn),
doc and doc.optional and '?' or ''
)