diff options
Diffstat (limited to 'script-beta/core')
-rw-r--r-- | script-beta/core/definition.lua | 9 | ||||
-rw-r--r-- | script-beta/core/hover/table.lua | 7 |
2 files changed, 9 insertions, 7 deletions
diff --git a/script-beta/core/definition.lua b/script-beta/core/definition.lua index 37d4e115..eb8f2715 100644 --- a/script-beta/core/definition.lua +++ b/script-beta/core/definition.lua @@ -125,21 +125,22 @@ return function (uri, offset) end vm.setSearchLevel(10) - vm.eachDef(source, function (src) + for _, src in ipairs(vm.getDefs(source, 'deep')) do local root = guide.getRoot(src) if not root then - return + goto CONTINUE end src = src.field or src.method or src.index or src if src.type == 'table' and src.parent.type ~= 'return' then - return + goto CONTINUE end results[#results+1] = { target = src, uri = files.getOriginUri(root.uri), source = source, } - end) + ::CONTINUE:: + end if #results == 0 then return nil diff --git a/script-beta/core/hover/table.lua b/script-beta/core/hover/table.lua index 314d0b42..d5761e17 100644 --- a/script-beta/core/hover/table.lua +++ b/script-beta/core/hover/table.lua @@ -172,10 +172,10 @@ end return function (source) local literals = {} local classes = {} - vm.eachField(source, function (src) + for _, src in ipairs(vm.getFields(source, 'deep')) do local key = getKey(src) if not key then - return + goto CONTINUE end local class, literal = getField(src) if not classes[key] then @@ -186,7 +186,8 @@ return function (source) end classes[key][#classes[key]+1] = class literals[key][#literals[key]+1] = literal - end) + ::CONTINUE:: + end clearClasses(classes) |