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

Enhancement - Allow ability to specify a default value for --- @param

Open Nexela opened this issue 2 years ago • 1 comments

Allow the ability to specify a default value for optional params.

Example:

--- @param a number
--- @param b=[32] number
--- @param c=[' '] string
--- @param d=[] any
--- @param e=[MyClass.subclass] MyClass
--- @return boolean
local function test(a, b, c. d, e

end

hovering over test could show function test(a: number, b=32: number, c=' ': string, d=nil: any, e=MyClass.subclass: MyClass)

Nexela avatar Apr 16 '22 17:04 Nexela

Completely agree with this, and came here to suggest the same. Also, there is an issue where the question mark appears after the type when having enabled the inlined declaration:

image

BribeFromTheHive avatar Aug 17 '22 07:08 BribeFromTheHive