Skip to content

Commit

Permalink
Merge pull request #2538 from AndreasMatthias/deprecated
Browse files Browse the repository at this point in the history
Add "deprecated" key in JSON output.
  • Loading branch information
sumneko authored Feb 26, 2024
2 parents 306a586 + af82302 commit f388b95
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions script/cli/doc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit f388b95

Please sign in to comment.