diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2018-12-07 11:57:21 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2018-12-07 11:57:21 +0800 |
commit | 0414a4e0179c158dc66d46e22d2c7cb2c3b3608e (patch) | |
tree | d167eece4e4229ae6aeb1192632fc3623fd3b737 /server/src/matcher | |
parent | 6b3920292359646f0f24f8770d83e8db755ef896 (diff) | |
download | lua-language-server-0414a4e0179c158dc66d46e22d2c7cb2c3b3608e.zip |
一些测试
Diffstat (limited to 'server/src/matcher')
-rw-r--r-- | server/src/matcher/find_lib.lua | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/server/src/matcher/find_lib.lua b/server/src/matcher/find_lib.lua index d4cb6bf2..84cf44c5 100644 --- a/server/src/matcher/find_lib.lua +++ b/server/src/matcher/find_lib.lua @@ -122,6 +122,15 @@ local function checkLib(var, name, lib) if not lib.source then return checkLibAsGlobal(var, name) end + for _, source in ipairs(lib.source) do + if source.type == 'global' then + local fullkey = checkLibAsGlobal(var, name) + if fullkey then + return fullkey + end + end + end + return nil end local function findLib(var, libs) @@ -136,6 +145,6 @@ end return function (var) local libs = getLibs() - local lib, key = findLib(var, libs) - return lib, key + local lib, fullkey = findLib(var, libs) + return lib, fullkey end |