Skip to content

Commit d0bfdaa

Browse files
Add "deprecated" key in JSON output.
1 parent beacc21 commit d0bfdaa

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

script/cli/doc.lua

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,10 @@ local function collectTypes(global, results)
192192
if vm.isAsync(source, true) then
193193
field.async = true
194194
end
195+
local depr = vm.getDeprecated(source)
196+
if (depr and not depr.versions) then
197+
field.deprecated = true
198+
end
195199
return
196200
end
197201
if source.type == 'tableindex' then
@@ -256,6 +260,10 @@ local function collectVars(global, results)
256260
if vm.isAsync(set, true) then
257261
result.defines[#result.defines].extends['async'] = true
258262
end
263+
local depr = vm.getDeprecated(set)
264+
if (depr and not depr.versions) then
265+
result.defines[#result.defines].extends['deprecated'] = true
266+
end
259267
end
260268
end
261269
if #result.defines == 0 then

0 commit comments

Comments
 (0)