diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2019-12-10 21:09:31 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2019-12-10 21:09:31 +0800 |
commit | 9dd7926771b7b6ad93b919746954bb68bde351a9 (patch) | |
tree | 403367b8864daf53d29f9cc4e7c0e71486c58a28 /script-beta/core/hover/label.lua | |
parent | e87c7b5567053de3d94f06c823a0d0962756b237 (diff) | |
download | lua-language-server-9dd7926771b7b6ad93b919746954bb68bde351a9.zip |
更新完成
Diffstat (limited to 'script-beta/core/hover/label.lua')
-rw-r--r-- | script-beta/core/hover/label.lua | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/script-beta/core/hover/label.lua b/script-beta/core/hover/label.lua index dd25d42e..21330b17 100644 --- a/script-beta/core/hover/label.lua +++ b/script-beta/core/hover/label.lua @@ -6,9 +6,9 @@ local getClass = require 'core.hover.class' local vm = require 'vm' local util = require 'utility' -local function asFunction(source, caller) - local name = buildName(source, caller) - local arg = buildArg(source, caller) +local function asFunction(source, oop) + local name = buildName(source, oop) + local arg = buildArg(source, oop) local rtn = buildReturn(source) local lines = {} lines[1] = ('function %s(%s)'):format(name, arg) @@ -28,7 +28,10 @@ local function asValue(source, title) type = nil end if lib then - name = ('%s<%s>'):format(name, buildName(lib)) + local libName = buildName(lib) + if name ~= libName then + name = ('%s<%s>'):format(name, buildName(lib)) + end end local pack = {} pack[#pack+1] = title @@ -108,9 +111,9 @@ local function asString(source) end end -return function (source, caller) +return function (source, oop) if source.type == 'function' then - return asFunction(source, caller) + return asFunction(source, oop) elseif source.type == 'local' or source.type == 'getlocal' or source.type == 'setlocal' then |