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

# @deprecated

> Mark functions or fields as deprecated to warn about usages.

## Overview

`@deprecated` marks a function, field, or class as deprecated. When your code uses that symbol, GLuaLS reports a `deprecated` diagnostic (hint by default) and shows strikethrough in completions.

***

## Syntax

```lua theme={null}
---@deprecated
---@deprecated Alternative or explanation
```

***

## Basic deprecation

```lua theme={null}
---@deprecated
function OldPlayerJoin(ply)
    -- ...
end
```

Calls to `OldPlayerJoin` show a deprecation hint.

***

## With a migration message

GLuaLS shows the message in the diagnostic and hover documentation:

```lua theme={null}
---@deprecated Use PLUGIN:OnPlayerSpawn(ply) instead
function OldSpawnHandler(ply)
    -- ...
end
```

***

## Deprecated fields

```lua theme={null}
---@class GameConfig
---@field maxPlayers number Max players allowed
---@field playerLimit number @deprecated Use maxPlayers instead
```

***

## Deprecated class

```lua theme={null}
---@deprecated Use NewPlayerManager instead
---@class OldPlayerManager
local OldPlayerManager = {}
```

***

## Severity

The `deprecated` diagnostic uses `hint` severity by default (subtle underline). You can change it:

<Tip>
  Use the settings menu instead of editing the JSON file directly. This helps you avoid config mistakes.
</Tip>

```json .gluarc.json theme={null}
{
  "diagnostics": {
    "severity": {
      "deprecated": "warning"
    }
  }
}
```
