summaryrefslogtreecommitdiff
path: root/script/vm/getDocs.lua
diff options
context:
space:
mode:
Diffstat (limited to 'script/vm/getDocs.lua')
-rw-r--r--script/vm/getDocs.lua34
1 files changed, 34 insertions, 0 deletions
diff --git a/script/vm/getDocs.lua b/script/vm/getDocs.lua
index 2fb2bda9..260d2281 100644
--- a/script/vm/getDocs.lua
+++ b/script/vm/getDocs.lua
@@ -163,6 +163,23 @@ local function isDeprecated(value)
return false
end
+local function isAsync(value)
+ 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
+
function vm.isDeprecated(value, deep)
if deep then
local defs = vm.getDefs(value)
@@ -180,6 +197,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 not isAsync(def) then
+ return false
+ end
+ end
+ return true
+ else
+ return isAsync(value)
+ end
+end
+
local function makeDiagRange(uri, doc, results)
local names
if doc.names then