diff options
Diffstat (limited to 'script/core')
-rw-r--r-- | script/core/completion/completion.lua | 3 | ||||
-rw-r--r-- | script/core/hover/args.lua | 2 | ||||
-rw-r--r-- | script/core/hover/return.lua | 12 |
3 files changed, 14 insertions, 3 deletions
diff --git a/script/core/completion/completion.lua b/script/core/completion/completion.lua index 392c21ca..243a9a76 100644 --- a/script/core/completion/completion.lua +++ b/script/core/completion/completion.lua @@ -165,7 +165,8 @@ local function buildFunctionSnip(source, value, oop) truncated = true end for i = #args, 1, -1 do - if args[i]:match('^%s*[^?]+%?:') then + if args[i]:match('^%s*[^?]+%?:') + or args[i]:match('^%.%.%.') then table.remove(args) truncated = true else diff --git a/script/core/hover/args.lua b/script/core/hover/args.lua index 21e7c00f..321fb081 100644 --- a/script/core/hover/args.lua +++ b/script/core/hover/args.lua @@ -32,7 +32,7 @@ local function asFunction(source) vm.getInfer(argNode):view(guide.getUri(source), 'any') ) elseif arg.type == '...' then - args[#args+1] = ('%s: %s'):format( + args[#args+1] = ('%s%s'):format( '...', vm.getInfer(arg):view(guide.getUri(source), 'any') ) diff --git a/script/core/hover/return.lua b/script/core/hover/return.lua index 7f96b282..b496990b 100644 --- a/script/core/hover/return.lua +++ b/script/core/hover/return.lua @@ -63,7 +63,10 @@ local function asFunction(source) for i = 1, num do local rtn = vm.getReturnOfFunction(source, i) local doc = docs[i] - local name = doc and doc.name and doc.name[1] and (doc.name[1] .. ': ') + local name = doc and doc.name and doc.name[1] + if name and name ~= '...' then + name = name .. ': ' + end local text = rtn and ('%s%s'):format( name or '', vm.getInfer(rtn):view(guide.getUri(source)) @@ -85,6 +88,13 @@ local function asDocFunction(source) local returns = {} for i, rtn in ipairs(source.returns) do local rtnText = vm.getInfer(rtn):view(guide.getUri(source)) + if rtn.name then + if rtn.name[1] == '...' then + rtnText = rtn.name[1] .. rtnText + else + rtnText = rtn.name[1] .. ': ' .. rtnText + end + end if i == 1 then returns[#returns+1] = (' -> %s'):format(rtnText) else |