Skip to content

Commit b204411

Browse files
committed
fix #1087
1 parent afbe46c commit b204411

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

script/core/diagnostics/missing-parameter.lua

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,6 @@ return function (uri, callback)
5151

5252
guide.eachSourceType(state.ast, 'call', function (source)
5353
local callArgs = countCallArgs(source)
54-
if callArgs == 0 then
55-
return
56-
end
5754

5855
local func = source.node
5956
local funcArgs = getFuncArgs(func)

test/diagnostics/common.lua

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,15 @@ end
257257
<!x(1)!>
258258
]]
259259

260+
TEST [[
261+
---@param a integer
262+
---@param b integer
263+
local function x(a, b)
264+
return a, b
265+
end
266+
<!x()!>
267+
]]
268+
260269
TEST [[
261270
---@param a integer
262271
---@param b integer
@@ -468,7 +477,7 @@ f(1, 2, 3)
468477
]]
469478

470479
TEST [[
471-
local _ = <!unpack!>()
480+
local _ = <!unpack!>
472481
]]
473482

474483
TEST [[
@@ -763,7 +772,9 @@ TEST [[
763772
local function f(x, y)
764773
return x, y
765774
end
766-
f()
775+
776+
local _
777+
f(_, _)
767778
]]
768779

769780
TEST [[
@@ -796,7 +807,7 @@ TEST [[
796807
TEST [[
797808
---@type fun(a: integer)
798809
local f
799-
f()
810+
f(1)
800811
]]
801812

802813
TEST [[
@@ -923,7 +934,7 @@ TEST [[
923934
local mt
924935
function mt:method1()
925936
mt.<!method2!>() -- doc.class
926-
self.method1()
937+
self:method1()
927938
return self.<!method2!>() -- doc.class.name
928939
end
929940
]]
@@ -1033,7 +1044,7 @@ return m
10331044
TEST [[
10341045
local m = {}
10351046
1036-
m.x = io.open()
1047+
m.x = io.open('')
10371048
m.x = nil
10381049
10391050
return m

0 commit comments

Comments
 (0)