Skip to main content

Overview

@realm sets the realm for a file or function. GLuaLS checks it before filename, folder, and if CLIENT/SERVER inference.

Syntax


File-level realm

File-level realm annotations are experimental. Use them only when GLuaLS infers the wrong realm for the whole file. Prefer function-level annotations for mixed files.
Place @realm at the top of a file to mark the whole file:

Function-level realm

Set the realm for one function inside a shared file:

Realm values

When @realm is missing

GLuaLS detects realm from:
  • Filename prefix (cl_*, sv_*, sh_*)
  • Directory (client/, server/, lua/autorun/client/, etc.)
  • if CLIENT / if SERVER blocks
Complex files can confuse realm detection.

See also