diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2019-03-04 17:42:09 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2019-03-04 17:42:09 +0800 |
commit | cf035623c1e0f6148cd4cee513ce25810d0d137e (patch) | |
tree | b361b920f74e52781b37596670ae81864f2af60b /server/src/core/find_lib.lua | |
parent | 4843133cf08b1a05c506665b5b84bdf6ccbea884 (diff) | |
download | lua-language-server-cf035623c1e0f6148cd4cee513ce25810d0d137e.zip |
部分library
Diffstat (limited to 'server/src/core/find_lib.lua')
-rw-r--r-- | server/src/core/find_lib.lua | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/server/src/core/find_lib.lua b/server/src/core/find_lib.lua index c4d5bff3..12eaa2fe 100644 --- a/server/src/core/find_lib.lua +++ b/server/src/core/find_lib.lua @@ -1,9 +1,5 @@ -local function findLib(var) - if var.type ~= 'local' and var.type ~= 'field' then - return nil - end - local value = var.value - local lib = value.lib +local function findLib(value) + local lib = value:getLib() if not lib then return nil end @@ -41,7 +37,10 @@ local function findLib(var) end end -return function (var) - local lib, fullKey, oo = findLib(var) - return lib, fullKey, oo +return function (source) + if source:bindValue() then + local lib, fullKey, oo = findLib(source:bindValue()) + return lib, fullKey, oo + end + return nil end |