From f3ef253b0c5ced3727e96df88fa16886f03325ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Tue, 27 Aug 2019 21:36:43 +0800 Subject: =?UTF-8?q?=E8=B0=83=E7=94=A8=E7=89=87=E6=AE=B5=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E6=9E=9A=E4=B8=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/src/core/hover/function.lua | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'server/src/core/hover/function.lua') diff --git a/server/src/core/hover/function.lua b/server/src/core/hover/function.lua index eab1ff59..6f8f325c 100644 --- a/server/src/core/hover/function.lua +++ b/server/src/core/hover/function.lua @@ -159,8 +159,11 @@ local function buildEnum(func) return nil end local strs = {} + local raw = {} for _, param in ipairs(params) do local first = true + local name = param:getName() + raw[name] = {} param:eachEnum(function (enum) if first then first = false @@ -174,12 +177,13 @@ local function buildEnum(func) if enum.comment then strs[#strs+1] = ' -- ' .. enum.comment end + raw[name][#raw[name]+1] = enum[1] end) end if #strs == 0 then return nil end - return table.concat(strs) + return table.concat(strs), raw end local function getComment(func) @@ -219,7 +223,7 @@ end return function (name, func, object, select) local argStr, argLabel, args = buildValueArgs(func, object, select) local returns = buildValueReturns(func) - local enum = buildEnum(func) + local enum, rawEnum = buildEnum(func) local comment = getComment(func) local overloads = getOverLoads(name, func, object, select) local headLen = #('function %s('):format(name) @@ -232,6 +236,7 @@ return function (name, func, object, select) label = title, description = comment, enum = enum, + rawEnum = rawEnum, argLabel = argLabel, overloads = overloads, args = args, -- cgit v1.2.3