The @return tag uses Ty for second field which doesn't support Opt <type>?, this seems to results in the following behaviour:
---Some func
---@param some? string Optional param parsed correctly
---@return string? #This end up as part of `some` param desc
function M.func(some) end
Yields
M.func({some?}) *M.func*
Some func
Parameters: ~
{some?} (string) Optional param parsed correctly
@return string? #This end up as part of `some` param desc
This may not be part of EmmyLua spec but lua_ls specific, but considering ---@param name? <type> works I would expect the same for ---@return <type>? #desc. ---@return string|nil #foo works fine.
The
@returntag usesTyfor second field which doesn't supportOpt<type>?, this seems to results in the following behaviour:Yields
M.func({some?}) *M.func* Some func Parameters: ~ {some?} (string) Optional param parsed correctly @return string? #This end up as part of `some` param descThis may not be part of EmmyLua spec but lua_ls specific, but considering
---@param name? <type>works I would expect the same for---@return <type>? #desc.---@return string|nil #fooworks fine.