ValueDoc class
Documents a constant value or typed global variable.
Use ValueDoc for library-level constants (like math.pi),
version strings (like _VERSION), or any exported value that is not a
function, table, alias, or enum.
Simple global constant
context.describeValue('_VERSION', const ValueDoc(
summary: 'The interpreter version.',
type: 'string',
value: '"LuaLike 1.0"',
));
---The interpreter version.
---@type string
_VERSION = "LuaLike 1.0"
Library-level numeric constant
context.describeValue('pi', const ValueDoc(
summary: 'The value of \\u03c0.',
type: 'number',
));
---The value of π.
---@type number
math.pi = math.pi or {}
Constant with deprecation and source
context.describeValue('oldValue', const ValueDoc(
summary: 'Legacy constant, use newValue instead.',
type: 'string',
deprecated: true,
source: 'src/constants.lua:5:1',
));
---@deprecated
---Legacy constant, use newValue instead.
---@source src/constants.lua:5:1
---@type string
Constructors
Properties
- deprecated → bool
-
Whether this value is deprecated.
final
- deprecatedReason → String?
-
Optional reason shown alongside the deprecation marker.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- see → String?
-
Cross-reference to another symbol (e.g.
"http.get").final - source → String?
-
Source file location (e.g.
"src/constants.lua:5:1").final - summary → String
-
One-line summary of what this value represents.
final
- type → String
-
The LuaLS type string (e.g.
"string","number","boolean").final - value → String?
-
Optional literal value representation (e.g.
'"LuaLike 1.0"').final - version → String?
-
Lua version constraint (e.g.
">5.2").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