DocParam class

Describes a single parameter accepted by a library function.

Each DocParam becomes a ---@param line in the generated LuaLS output.

Required parameter

DocParam('name', 'string', 'The display name.')
---@param name string # The display name.

Optional parameter

DocParam('age', 'number', 'The age in years.', optional: true)
---@param age? number # The age in years.

Variadic parameter

Use '...' as the name — the ? suffix is automatically suppressed for variadics.

DocParam('...', 'string', 'One or more tag names.')
---@param ... string # One or more tag names.

Constructors

DocParam(String name, String type, String description, {bool optional = false})
const

Properties

description String
A human-readable description of what this parameter controls.
final
hashCode int
The hash code for this object.
no setterinherited
name String
The parameter name as it appears in the Lua API (e.g. "s", "i").
final
optional bool
Whether this parameter is optional (defaults to false).
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
type String
The Lua type of the parameter (e.g. "string", "number", "table").
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited