Overview
field_accessor links a class field to the methods that read and write it. Go to definition on the field then lists the getter and setter too.
It only affects navigation. The methods must be on the same class.
Syntax
@field line.
- Convention builds the method names from the field name:
camelCase(getAge),PascalCase(GetAge) orsnake_case(get_age). It defaults tocamelCase. - Getter and setter name the methods directly and take precedence over the convention.
Example
Garry’s Mod methods are usuallyPascalCase:
vehicle.Speed now offers the field, GetSpeed and SetSpeed.