Skip to content

Commit

Permalink
fix #1093
Browse files Browse the repository at this point in the history
  • Loading branch information
sumneko committed Apr 26, 2022
1 parent e644ee2 commit 6632a27
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# changelog

## 3.2.2
* `FIX` [#1093](https://github.com/sumneko/lua-language-server/issues/1093)
* `FIX` runtime errors reported by telemetry, see [#1091](https://github.com/sumneko/lua-language-server/issues/1091)

## 3.2.1
Expand Down
5 changes: 4 additions & 1 deletion script/core/diagnostics/unused-function.lua
Original file line number Diff line number Diff line change
Expand Up @@ -87,5 +87,8 @@ return function (uri, callback)
end

-- 只检查局部函数
guide.eachSourceType(ast.ast, 'function', checkFunction)
---@async
guide.eachSourceType(ast.ast, 'function', function (src)
checkFunction(src)
end)
end
9 changes: 9 additions & 0 deletions test/diagnostics/common.lua
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,15 @@ local <!function f()
end!>
]]


TEST [[
local <!function test()
end!>
local <!function foo ()
end!>
]]

config.get(nil, 'Lua.diagnostics.disable')['unused-local'] = nil
TEST [[
local mt, x
Expand Down

0 comments on commit 6632a27

Please sign in to comment.