Overview
@enum marks a local table as an enum type. Table values become valid enum members. GLuaLS can report invalid enum values with enum-value-mismatch when you enable that diagnostic.
Syntax
Basic enum
String enums
(key) modifier
Use (key) when the table keys are the enum values:
Enum vs. @alias
Both@enum and @alias with ---| can describe a fixed set of values. Use:
@enumwhen your addon has a Lua table of named constants that code reads at runtime@aliaswith---|when a string parameter accepts a fixed set of text values
Common patterns in GMod
DAMAGE, TEAM, and MOVETYPE, come from the downloaded annotations. You do not need to redeclare them.