diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2020-08-17 18:44:03 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2020-08-17 18:44:03 +0800 |
commit | 3e4411e10f8c0ebd10341450edd6c868866d04cb (patch) | |
tree | e086ebf19d7f4302dd90b54fbf6248d1374336e7 /script-beta/vm/getLibrary.lua | |
parent | eb822b74afdec570e500b8e6778f8d6d30a8d98a (diff) | |
download | lua-language-server-3e4411e10f8c0ebd10341450edd6c868866d04cb.zip |
特殊处理getLibrary
Diffstat (limited to 'script-beta/vm/getLibrary.lua')
-rw-r--r-- | script-beta/vm/getLibrary.lua | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/script-beta/vm/getLibrary.lua b/script-beta/vm/getLibrary.lua index 69bc3f2b..e9c3b78a 100644 --- a/script-beta/vm/getLibrary.lua +++ b/script-beta/vm/getLibrary.lua @@ -6,6 +6,10 @@ local function checkStdLibrary(source) if source.library then return source end + local value = guide.getObjectValue(source) + if value and value.type == 'select' then + source = value + end if source.type == 'getglobal' or source.type == 'setglobal' then local name = guide.getName(source) @@ -79,8 +83,8 @@ local function checkNode(source) end end -local function checkRef(source) - local results = guide.requestReference(source) +local function checkDef(source) + local results = guide.requestDefinition(source) for _, src in ipairs(results) do local lib = checkStdLibrary(src) or checkNode(src) if lib then @@ -93,7 +97,7 @@ end local function getLibrary(source) return checkNode(source) or checkStdLibrary(source) - or checkRef(source) + or checkDef(source) end function vm.getLibrary(source) |