diff options
author | Andreas <andreas.matthias@gmail.com> | 2024-02-18 00:24:26 +0100 |
---|---|---|
committer | Andreas <andreas.matthias@gmail.com> | 2024-02-20 18:59:22 +0100 |
commit | 3a1abeee5fa24fb5bd280090fd82e6ca36900720 (patch) | |
tree | c917764b237eb439365e55557c3ba118523fa6b0 /script/cli/doc.lua | |
parent | 25cb0bdd2a27a5e3ebdd5a7ebc999add296c7c28 (diff) | |
download | lua-language-server-3a1abeee5fa24fb5bd280090fd82e6ca36900720.zip |
Add "deprecated" key in JSON output.
Diffstat (limited to 'script/cli/doc.lua')
-rw-r--r-- | script/cli/doc.lua | 8 |
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 |