> ## Documentation Index
> Fetch the complete documentation index at: https://gluals.arnux.net/llms.txt
> Use this file to discover all available pages before exploring further.

# @version

> Restrict a definition to specific Lua versions.

## 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

```lua theme={null}
---@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

```lua theme={null}
---@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.
