From 3a1abeee5fa24fb5bd280090fd82e6ca36900720 Mon Sep 17 00:00:00 2001 From: Andreas Date: Sun, 18 Feb 2024 00:24:26 +0100 Subject: Add "deprecated" key in JSON output. --- script/cli/doc.lua | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'script/cli/doc.lua') diff --git a/script/cli/doc.lua b/script/cli/doc.lua index fb9b0a8e..7b1cdca2 100644 --- a/script/cli/doc.lua +++ b/script/cli/doc.lua @@ -189,6 +189,10 @@ local function collectTypes(global, results) field.rawdesc = getDesc(source, true) field.extends = packObject(source.value) field.visible = vm.getVisibleType(source) + local depr = vm.getDeprecated(source) + if (depr and not depr.versions) then + field.deprecated = true + end return end if source.type == 'tableindex' then @@ -250,6 +254,10 @@ local function collectVars(global, results) result.rawdesc = result.rawdesc or getDesc(set, true) result.defines[#result.defines].extends['desc'] = getDesc(set) result.defines[#result.defines].extends['rawdesc'] = getDesc(set, true) + local depr = vm.getDeprecated(set) + if (depr and not depr.versions) then + result.defines[#result.defines].extends['deprecated'] = true + end end end if #result.defines == 0 then -- cgit v1.2.3