diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2019-11-29 17:41:07 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2019-11-29 17:41:07 +0800 |
commit | b5d452f3cc7315940e860a21c9bb15673e544d9c (patch) | |
tree | e41be9b3e923eef40adb4a62b77e03b4797099b0 /script-beta/vm | |
parent | cbf18dc54d2d2315ae3bace888fc428550149c7a (diff) | |
download | lua-language-server-b5d452f3cc7315940e860a21c9bb15673e544d9c.zip |
支持 lib 函数的 arg 与 return
Diffstat (limited to 'script-beta/vm')
-rw-r--r-- | script-beta/vm/getValue.lua | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/script-beta/vm/getValue.lua b/script-beta/vm/getValue.lua index ef3a5504..67954360 100644 --- a/script-beta/vm/getValue.lua +++ b/script-beta/vm/getValue.lua @@ -538,6 +538,20 @@ local function checkDef(results, source) end) end +local function checkLibraryTypes(source) + if type(source.type) ~= 'table' then + return nil + end + local results = {} + for i = 1, #source.type do + insert(results, { + type = source.type[i], + source = source, + }) + end + return results +end + local function checkLibrary(source) local lib = vm.getLibrary(source) if not lib then @@ -730,6 +744,7 @@ local function getValue(source) or checkValue(source) or checkUnary(source) or checkBinary(source) + or checkLibraryTypes(source) or checkLibrary(source) or checkLibraryReturn(source) or checkLibraryArg(source) |