diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2020-10-29 21:43:43 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2020-10-29 21:43:43 +0800 |
commit | 4e9f8c16ed240d949cf06aa3bdd9736bdff7e737 (patch) | |
tree | 97bb6c2b15c2982f12315c9a591ffb5045660f73 /script-beta/vm/getClass.lua | |
parent | 1aff4a30c4c2cebba241fbff442eacb6e98ac328 (diff) | |
download | lua-language-server-4e9f8c16ed240d949cf06aa3bdd9736bdff7e737.zip |
构建 table 先写个 TODO
Diffstat (limited to 'script-beta/vm/getClass.lua')
-rw-r--r-- | script-beta/vm/getClass.lua | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/script-beta/vm/getClass.lua b/script-beta/vm/getClass.lua index ec86e0cf..2a507b12 100644 --- a/script-beta/vm/getClass.lua +++ b/script-beta/vm/getClass.lua @@ -11,8 +11,8 @@ local function lookUpDocClass(source) end end -local function getClass(source, classes, deep, simple) - local lib = vm.getLibrary(source, simple) +local function getClass(source, classes, depth, deep) + local lib = vm.getLibrary(source, deep) if lib then if lib.value.type == 'table' then classes[#classes+1] = lib.value.name @@ -26,11 +26,11 @@ local function getClass(source, classes, deep, simple) classes[#classes+1] = docClass return end - if deep > 3 then + if depth > 3 then return end local value = guide.getObjectValue(source) or source - if simple and value == source then + if deep and value == source then if value and value.type == 'string' then classes[#classes+1] = value[1] end @@ -56,13 +56,13 @@ local function getClass(source, classes, deep, simple) return end vm.eachMeta(source, function (mt) - getClass(mt, classes, deep + 1, simple) + getClass(mt, classes, depth + 1, deep) end) end -function vm.getClass(source, simple) +function vm.getClass(source, deep) local classes = {} - getClass(source, classes, 1, simple) + getClass(source, classes, 1, deep) if #classes == 0 then return nil end |