summaryrefslogtreecommitdiff
path: root/script-beta/core
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2019-12-09 15:00:29 +0800
committer最萌小汐 <sumneko@hotmail.com>2019-12-09 15:00:29 +0800
commit9f621b6076181e577748dda3966bbc526586445d (patch)
tree05057166585d0f229030c44718312432ab163dc7 /script-beta/core
parent1e3726e3d3f6c84ce29e857181261b5ffb2d0da3 (diff)
downloadlua-language-server-9f621b6076181e577748dda3966bbc526586445d.zip
支持看lib的table
Diffstat (limited to 'script-beta/core')
-rw-r--r--script-beta/core/hover/label.lua3
-rw-r--r--script-beta/core/hover/name.lua7
2 files changed, 7 insertions, 3 deletions
diff --git a/script-beta/core/hover/label.lua b/script-beta/core/hover/label.lua
index bcc65b8d..dd25d42e 100644
--- a/script-beta/core/hover/label.lua
+++ b/script-beta/core/hover/label.lua
@@ -27,6 +27,9 @@ local function asValue(source, title)
cont = buildTable(source)
type = nil
end
+ if lib then
+ name = ('%s<%s>'):format(name, buildName(lib))
+ end
local pack = {}
pack[#pack+1] = title
pack[#pack+1] = name .. ':'
diff --git a/script-beta/core/hover/name.lua b/script-beta/core/hover/name.lua
index 7b8cf449..917bf96d 100644
--- a/script-beta/core/hover/name.lua
+++ b/script-beta/core/hover/name.lua
@@ -29,9 +29,10 @@ end
local function asLibrary(source, caller)
local p
- if caller.type == 'method'
- or caller.type == 'getmethod'
- or caller.type == 'setmethod' then
+ if caller
+ and (caller.type == 'method'
+ or caller.type == 'getmethod'
+ or caller.type == 'setmethod') then
if source.parent then
for _, parent in ipairs(source.parent) do
if parent.type == 'object' then