diff options
Diffstat (limited to 'script')
-rw-r--r-- | script/core/diagnostics/unused-local.lua | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/script/core/diagnostics/unused-local.lua b/script/core/diagnostics/unused-local.lua index d12ceb2b..a637f427 100644 --- a/script/core/diagnostics/unused-local.lua +++ b/script/core/diagnostics/unused-local.lua @@ -63,18 +63,16 @@ local function isDocClass(source) return false end -local function isDocParam(source) - if not source.bindDocs then +---@param source parser.object +local function isDeclareFunctionParam(source) + if source.parent.type ~= 'funcargs' then return false end - for _, doc in ipairs(source.bindDocs) do - if doc.type == 'doc.param' then - if doc.param[1] == source[1] then - return true - end - end + local func = source.parent.parent + if #func > 0 then + return false end - return false + return true end return function (uri, callback) @@ -94,7 +92,7 @@ return function (uri, callback) if isDocClass(source) then return end - if vm.isMetaFile(uri) and isDocParam(source) then + if isDeclareFunctionParam(source) then return end local data = hasGet(source) |