diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-06-20 15:54:56 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-06-20 15:54:56 +0800 |
commit | 99691a901cc26bc44720ced49729d436a09129ba (patch) | |
tree | fc57d2d0aecd6081e360c637bf284c9a98983e65 /script/vm/doc.lua | |
parent | a6ed5f5845d3a859bd88c72f47bc4fa9d120b2df (diff) | |
download | lua-language-server-99691a901cc26bc44720ced49729d436a09129ba.zip |
update
Diffstat (limited to 'script/vm/doc.lua')
-rw-r--r-- | script/vm/doc.lua | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/script/vm/doc.lua b/script/vm/doc.lua index 6ee00192..31d7f0ff 100644 --- a/script/vm/doc.lua +++ b/script/vm/doc.lua @@ -90,10 +90,10 @@ end ---@return parser.object? local function getDeprecated(value) if not value.bindDocs then - return false + return nil end if value._deprecated ~= nil then - return value._deprecated + return value._deprecated or nil end for _, doc in ipairs(value.bindDocs) do if doc.type == 'doc.deprecated' then @@ -108,7 +108,7 @@ local function getDeprecated(value) end end value._deprecated = false - return false + return nil end ---@return parser.object? @@ -116,9 +116,9 @@ function vm.getDeprecated(value, deep) if deep then local defs = vm.getDefs(value) if #defs == 0 then - return false + return nil end - local deprecated = false + local deprecated for _, def in ipairs(defs) do if def.type == 'setglobal' or def.type == 'setfield' @@ -128,7 +128,7 @@ function vm.getDeprecated(value, deep) or def.type == 'tableindex' then deprecated = getDeprecated(def) if not deprecated then - return false + return nil end end end |