diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2024-02-26 10:42:42 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-26 10:42:42 +0800 |
commit | f388b95de3188e97d670bd6f1924325637446cf7 (patch) | |
tree | 5d16ad975ef5ea0671ccb216699eef46081526f4 | |
parent | 306a5860aa3fe5cc2f800833bc80815604766be1 (diff) | |
parent | af823022cbb5022140c07588359ea30d73805395 (diff) | |
download | lua-language-server-f388b95de3188e97d670bd6f1924325637446cf7.zip |
Merge pull request #2538 from AndreasMatthias/deprecated
Add "deprecated" key in JSON output.
-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 |