summaryrefslogtreecommitdiff
path: root/script
diff options
context:
space:
mode:
authorJakub <jakubmomot@yahoo.pl>2024-03-25 22:53:09 +0100
committerJakub <jakubmomot@yahoo.pl>2024-03-25 22:53:09 +0100
commitce938c864604155fc081dab017867e7e461c61cc (patch)
tree170e47b48c372963018a6128319cf70f2daa3694 /script
parente930179bbd6b3eb26721a676303e0e27cdb29290 (diff)
downloadlua-language-server-ce938c864604155fc081dab017867e7e461c61cc.zip
Detect discard-returns in all block types
Diffstat (limited to 'script')
-rw-r--r--script/core/diagnostics/discard-returns.lua4
1 files changed, 1 insertions, 3 deletions
diff --git a/script/core/diagnostics/discard-returns.lua b/script/core/diagnostics/discard-returns.lua
index cef7ece5..9e573596 100644
--- a/script/core/diagnostics/discard-returns.lua
+++ b/script/core/diagnostics/discard-returns.lua
@@ -12,9 +12,7 @@ return function (uri, callback)
end
---@async
guide.eachSourceType(state.ast, 'call', function (source)
- local parent = source.parent
- if parent.type ~= 'function'
- and parent.type ~= 'main' then
+ if not guide.isBlockType(source.parent) then
return
end
await.delay()