Skip to main content

What are annotations?

Annotations are comments that start with ---@. They give GLuaLS type information. Put them above functions, variables, and class definitions so GLuaLS can provide better completion, type checking, and hover docs.
Annotations do not affect runtime. Garry’s Mod treats them as normal comments. GLuaLS follows EmmyLua-style annotations and adds Garry’s Mod Lua extensions for realms, hooks, wrappers, and editor tooling. It keeps compatibility with EmmyLua and LuaLS where possible.

Type system annotations

Function annotations

Garry’s Mod Lua annotations

Control and metadata annotations


Type expression syntax

Annotations use the same type expression syntax across all @ tags: