diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2019-11-21 21:07:36 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2019-11-21 21:07:36 +0800 |
commit | 82a58888b1951b37351e07ee9b2ae888732d26c0 (patch) | |
tree | 9905bd40c281530d16d62cb27aec5dad968e803a /server-beta/src | |
parent | 3bd61890073f9ff69b214e84843c71be94890edc (diff) | |
download | lua-language-server-82a58888b1951b37351e07ee9b2ae888732d26c0.zip |
暂存
Diffstat (limited to 'server-beta/src')
-rw-r--r-- | server-beta/src/core/hover/label.lua | 6 | ||||
-rw-r--r-- | server-beta/src/core/hover/return.lua | 14 |
2 files changed, 18 insertions, 2 deletions
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 |