From 82a58888b1951b37351e07ee9b2ae888732d26c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Thu, 21 Nov 2019 21:07:36 +0800 Subject: =?UTF-8?q?=E6=9A=82=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server-beta/src/core/hover/label.lua | 6 ++++-- server-beta/src/core/hover/return.lua | 14 ++++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 server-beta/src/core/hover/return.lua (limited to 'server-beta/src/core/hover') diff --git a/server-beta/src/core/hover/label.lua b/server-beta/src/core/hover/label.lua index 1dc66fc5..a9e7ba13 100644 --- a/server-beta/src/core/hover/label.lua +++ b/server-beta/src/core/hover/label.lua @@ -1,9 +1,11 @@ -local buildName = require 'core.hover.name' -local buildArg = require 'core.hover.arg' +local buildName = require 'core.hover.name' +local buildArg = require 'core.hover.arg' +local buildReturn = require 'core.hover.return' local function asFunction(source) local name = buildName(source) local arg = buildArg(source) + local rtn = buildReturn(source) return ('function %s(%s)'):format(name, arg) end diff --git a/server-beta/src/core/hover/return.lua b/server-beta/src/core/hover/return.lua new file mode 100644 index 00000000..dbc3df85 --- /dev/null +++ b/server-beta/src/core/hover/return.lua @@ -0,0 +1,14 @@ +local guide = require 'parser.guide' +local vm = require 'vm' + +local function asFunction(source) + if not source.returns then + return nil + end +end + +return function (source) + if source.type == 'function' then + return asFunction(source) + end +end -- cgit v1.2.3