diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2018-12-12 16:10:26 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2018-12-12 16:10:26 +0800 |
commit | fa0f8b12d5e6d15bd3a3fdb994c20d2fce2a1fbf (patch) | |
tree | d5e6ef03e3b753af8a4fcbf95f58c3ae2fcd79ff /server/src/matcher/find_lib.lua | |
parent | ee64096a59701bb9a756b44da3e51ec198920601 (diff) | |
download | lua-language-server-fa0f8b12d5e6d15bd3a3fdb994c20d2fce2a1fbf.zip |
find_lib支持对象
Diffstat (limited to 'server/src/matcher/find_lib.lua')
-rw-r--r-- | server/src/matcher/find_lib.lua | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/server/src/matcher/find_lib.lua b/server/src/matcher/find_lib.lua index d2b5d6a8..e4ea6e02 100644 --- a/server/src/matcher/find_lib.lua +++ b/server/src/matcher/find_lib.lua @@ -22,7 +22,19 @@ local function findLib(var) return lib, fullKey, false end else - return lib, lib.name, false + local res + if not lib.source then + return lib, lib.nick or lib.name, false + end + for _, source in ipairs(lib.source) do + if source.type == value.parentType then + res = source + end + end + if not res then + return lib, lib.nick or lib.name, false + end + return lib, res.nick or res.name or lib.nick or lib.name, false end end |