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.

Types

Functions

Realms and hooks

Utilities

Advanced

These annotations are intended for complex cases and are primarily designed to be used by the built-in annotations.

Type expression syntax

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