summaryrefslogtreecommitdiff
path: root/script/core
diff options
context:
space:
mode:
authorCr4xy <Cr4xy@Live.de>2021-10-25 14:42:39 +0200
committerCr4xy <Cr4xy@Live.de>2021-10-25 14:42:39 +0200
commita7102fa03eee98acb55265145f6c08b0c2dea158 (patch)
tree88fabc67c866326e26e36eab0b5c2f3964deb4f1 /script/core
parent751e5b623184005532eac6fa12f9b1094030a613 (diff)
downloadlua-language-server-a7102fa03eee98acb55265145f6c08b0c2dea158.zip
only mark return without any values
Diffstat (limited to 'script/core')
-rw-r--r--script/core/diagnostics/redundant-return.lua9
1 files changed, 2 insertions, 7 deletions
diff --git a/script/core/diagnostics/redundant-return.lua b/script/core/diagnostics/redundant-return.lua
index 3d0fc566..b76d8efa 100644
--- a/script/core/diagnostics/redundant-return.lua
+++ b/script/core/diagnostics/redundant-return.lua
@@ -14,13 +14,8 @@ return function (uri, callback)
if not source.parent or source.parent.type ~= "function" then
return
end
- for _, node in ipairs(source) do
- while node and node.type == "paren" do
- node = node.exp
- end
- if node and (node.type ~= "nil" or #node > 0) then
- return
- end
+ if #source > 0 then
+ return
end
callback {
start = source.start,