Skip to content

Can function aliases have parameter descriptions? #3372

@ChillerDragon

Description

@ChillerDragon

I guessed the syntax. Is it possible to type an alias for a function and give parameters not only types but also descriptions?

Image

The @param part seems to be ignored.

---@meta


---@param client_id integer the id of the client
---@param data string raw data
---@param flags integer bitwise flags
---@alias OnServerMessage fun(client_id: integer, data: string, flags: integer)

---@type OnServerMessage
function on_server_message(client_id, data, flags)
	print(client_id)
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions