Skip to main content

Overview

@version marks a definition for specific Lua versions. GLuaLS compares this annotation with runtime.version before it shows a field or function. Garry’s Mod projects target LuaJIT. Use this annotation in shared annotation files and standard-library docs.

Syntax

---@version >5.1, JIT
Operators: >, <.
  • > 5.1 means Lua 5.1 and newer
  • < 5.4 means Lua 5.4 and older
  • Versions: 5.1, 5.2, 5.3, 5.4, JIT

Usage

---@version >5.2
function string.pack(fmt, ...) end

-- If your workspace is set to LuaJIT, this definition is treated as unavailable.

Compatibility

Set your workspace version with runtime.version. In a Garry’s Mod project, choose LuaJIT.