diff options
-rw-r--r-- | script/core/diagnostics.lua | 7 | ||||
-rw-r--r-- | test/diagnostics/normal.lua | 4 |
2 files changed, 11 insertions, 0 deletions
diff --git a/script/core/diagnostics.lua b/script/core/diagnostics.lua index 499c5ffd..82a7f6ad 100644 --- a/script/core/diagnostics.lua +++ b/script/core/diagnostics.lua @@ -35,6 +35,13 @@ function mt:searchUnusedLocals(callback) if loc:get 'hide' then return end + if loc.tags then + for _, tag in ipairs(loc.tags) do + if tag[1] == 'close' then + return + end + end + end local used = loc:eachInfo(function (info) if info.type == 'get' then return true diff --git a/test/diagnostics/normal.lua b/test/diagnostics/normal.lua index 4ead6df5..a49858e5 100644 --- a/test/diagnostics/normal.lua +++ b/test/diagnostics/normal.lua @@ -356,6 +356,10 @@ end ]] TEST [[ +local f <close> = io.open() +]] + +TEST [[ ---@class <!Class!> ---@class <!Class!> ]] |