lua-language-server icon indicating copy to clipboard operation
lua-language-server copied to clipboard

Undefined `@param` warning if parameters are in separate lines

Open mfussenegger opened this issue 3 years ago • 1 comments

How are you using the lua-language-server?

NeoVim

Which OS are you using?

Linux

What is the issue affecting?

Annotations

Expected Behaviour

No diagnostics warning

Actual Behaviour

Server reports a warning

Reproduction steps

Create a file with:

---@param foo table
local function bar(foo)
  print(foo)
end

---@param foo table
local function baz(
  foo
)
  print(foo)
end

bar({})
baz({})

lua-language-server 3.5.2 reports a "Undefined param foo" warning on baz. On bar no warning is reported. This is mostly a problem with many parameters where tools like stylua start to put all parameters on a newline.

Additional Notes

No response

Log File

No response

mfussenegger avatar Aug 07 '22 09:08 mfussenegger

Same here: How are you using the lua-language-server? Visual Studio Code

Which OS are you using? Windows

lua-language-server 3.5.2

klaushipp avatar Aug 10 '22 20:08 klaushipp