diff options
Diffstat (limited to 'script/vm/getDocs.lua')
-rw-r--r-- | script/vm/getDocs.lua | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/script/vm/getDocs.lua b/script/vm/getDocs.lua index 2fb2bda9..ed2299ec 100644 --- a/script/vm/getDocs.lua +++ b/script/vm/getDocs.lua @@ -163,6 +163,26 @@ local function isDeprecated(value) return false end +local function isAsync(value) + if value.type == 'function' then + if not value.bindDocs then + return false + end + if value._async ~= nil then + return value._async + end + for _, doc in ipairs(value.bindDocs) do + if doc.type == 'doc.async' then + value._async = true + return true + end + end + value._async = false + return false + end + return value.async == true +end + function vm.isDeprecated(value, deep) if deep then local defs = vm.getDefs(value) @@ -180,6 +200,23 @@ function vm.isDeprecated(value, deep) end end +function vm.isAsync(value, deep) + if deep then + local defs = vm.getDefs(value) + if #defs == 0 then + return false + end + for _, def in ipairs(defs) do + if isAsync(def) then + return true + end + end + return false + else + return isAsync(value) + end +end + local function makeDiagRange(uri, doc, results) local names if doc.names then |