Skip to main content
The same ---@ dialect the Lua Language Server uses, so annotations you already have work here, and anything you write here keeps working there. Every tag and every type form the parser recognises is listed below.

Annotation tags

Type syntax

Unions, optionals, arrays and generic tables all compose:

Full example

An explicit ---@param or ---@type always beats inference. That is the escape hatch for code shapes inference cannot follow — dynamic tables, values built through a helper the server does not know about.
---@type only takes effect on a local declaration, and only for the first name when a statement declares several (local a, b = ...). It has no effect on a plain assignment (x = value) or a table field (self.x = value). See Casting with ---@type for examples.
A ---@param with no type is treated as documentation, not a type. Writing --- @param ply the player who did it will not create a type called the — the tag is only honoured when the second word is recognisably a type.
The deprecated diagnostic is raised for API that the Garry’s Mod wiki marks deprecated. ---@deprecated on your own functions is currently documentation only; it does not yet produce a diagnostic at call sites.