summaryrefslogtreecommitdiff
path: root/script/cli/doc.lua
diff options
context:
space:
mode:
authorAndreas <andreas.matthias@gmail.com>2024-02-18 00:24:26 +0100
committerAndreas <andreas.matthias@gmail.com>2024-02-20 18:59:22 +0100
commit3a1abeee5fa24fb5bd280090fd82e6ca36900720 (patch)
treec917764b237eb439365e55557c3ba118523fa6b0 /script/cli/doc.lua
parent25cb0bdd2a27a5e3ebdd5a7ebc999add296c7c28 (diff)
downloadlua-language-server-3a1abeee5fa24fb5bd280090fd82e6ca36900720.zip
Add "deprecated" key in JSON output.
Diffstat (limited to 'script/cli/doc.lua')
-rw-r--r--script/cli/doc.lua8
1 files changed, 8 insertions, 0 deletions
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