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

# Garry's Mod settings

> Language server settings for realm analysis, scripted classes, networking, VGUI, and annotations.

## Overview

Garry's Mod Lua settings live under the `gmod` key in `.gluarc.json`. These settings control realm detection, network message analysis, scripted class behavior, VGUI support, annotations, and more.

***

## Top-level options

| Option                         | Type              | Default                     | Description                                                                                                                                              |
| ------------------------------ | ----------------- | --------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `gmod.enabled`                 | `boolean`         | `true`                      | Enable Garry's Mod Lua analysis. Keep this enabled for normal use; set `false` only when isolating compatibility or debugging issues                     |
| `gmod.defaultRealm`            | `string`          | `"shared"`                  | Realm assumed for files with no realm signal. Use `"client"`, `"server"`, or `"shared"`                                                                  |
| `gmod.detectRealmFromFilename` | `boolean \| null` | `null` (resolves to `true`) | Detect realm from `cl_`, `sv_`, `sh_` filename prefixes and `/client/`, `/server/` parent directories                                                    |
| `gmod.detectRealmFromCalls`    | `boolean \| null` | `null` (resolves to `true`) | Infer realm from calls like `include`, `AddCSLuaFile`, `IncludeCS`, `require`, and annotated wrappers                                                    |
| `gmod.inferDynamicFields`      | `boolean`         | `true`                      | Track fields dynamically assigned to Garry's Mod objects                                                                                                 |
| `gmod.dynamicFieldsGlobal`     | `boolean`         | `true`                      | Share inferred dynamic fields across all files. Set `false` to scope them per-file                                                                       |
| `gmod.fileParamDefaults`       | `object`          | built-in map                | Default types for common parameter names when a parameter has no `@param`. Editable in the Settings UI. Set a value to `""` to remove a built-in default |

***

## Annotations

| Option                     | Type              | Default | Description                                                                                                                   |
| -------------------------- | ----------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------- |
| `gmod.annotationsPath`     | `string \| null`  | `null`  | Custom path to Garry's Mod annotation `.lua` files. When `null`, the VS Code extension can provide its downloaded annotations |
| `gmod.autoLoadAnnotations` | `boolean \| null` | `null`  | Override workspace annotation auto-loading. Set `false` to disable even if the extension or CLI provides annotations          |

***

## Scaffolding

| Option              | Type             | Default | Description                                                                                                                          |
| ------------------- | ---------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| `gmod.templatePath` | `string \| null` | `null`  | Path to a folder of custom scaffolding templates (`.lua` files). Relative to workspace root. Built-in templates are used as fallback |

***

## Gamemode inheritance

GLuaLS supports gamemode inheritance. `DeriveGamemode("...")` keeps inherited `GM` members working. The `gmod.autoDetectGamemodeBase` setting loads parent gamemode folders from your gamemode's `<name>.txt` `base` value so parent files are available for completions, definitions, and diagnostics.

This setting controls the `.txt` file lookup. `DeriveGamemode("...")` support remains active.

| Option                        | Type              | Default          | Description                                                                                                         |
| ----------------------------- | ----------------- | ---------------- | ------------------------------------------------------------------------------------------------------------------- |
| `gmod.autoDetectGamemodeBase` | `boolean \| null` | `null` (enabled) | Automatically loads parent gamemode folders from the gamemode `.txt` `base` value. Set to `false` to turn this off. |

***

## Scripted classes

`gmod.scriptedClassScopes.include` defines the scripted class groups used for class analysis, the Class Explorer, and scaffolding.

Built-in groups: `entities`, `weapons`, `effects`, `stools`, `player_classes`, `plugins`, `schemas`, `gamemodes`.

The `schemas` group is enabled by default for any framework or gamemode. Files beneath a `schema/` directory, plus single-file `gamemode/schema.lua` entrypoints, contribute to one global `SCHEMA` class. `Schema` is recognized as an alias throughout the project, and schema methods are analyzed as gamemode hooks inherited from `GM`. No framework-specific configuration is required.

Each definition supports:

| Field               | Type       | Description                                                                                                                                         |
| ------------------- | ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| `id`                | `string`   | Name used to change or remove this entry                                                                                                            |
| `label`             | `string`   | Display name in Class Explorer and Settings UI                                                                                                      |
| `classGlobal`       | `string`   | Global variable the class uses (`ENT`, `SWEP`, etc.)                                                                                                |
| `fixedClassName`    | `string`   | Fixed internal class name used instead of deriving one from the path                                                                                |
| `isGlobalSingleton` | `boolean`  | Merge every matching file into one workspace-wide global class                                                                                      |
| `aliases`           | `string[]` | Additional global names that refer to the same class                                                                                                |
| `superTypes`        | `string[]` | Types inherited by the class, such as `GM` for gamemode hooks                                                                                       |
| `path`              | `string[]` | Path segments to detect class from file path                                                                                                        |
| `include`           | `string[]` | Glob patterns for files to analyse                                                                                                                  |
| `exclude`           | `string[]` | Optional per-definition exclude globs                                                                                                               |
| `parentId`          | `string`   | Parent definition ID for nested grouping in Explorer                                                                                                |
| `icon`              | `string`   | VS Code icon ID for Class Explorer display                                                                                                          |
| `rootDir`           | `string`   | Default root used by the scaffold action                                                                                                            |
| `scaffold.files`    | `array`    | Scaffold output entries: `{ path, template }` with `{{name}}` variable                                                                              |
| `classNamePrefix`   | `string`   | Optional prefix prepended to the folder-derived class name. Used by the `gamemodes` scope to produce runtime-accurate names like `gamemode_sandbox` |
| `disabled`          | `boolean`  | Disable this definition (useful for turning off built-in groups)                                                                                    |

The `gamemodes` group detects files under `gamemodes/<name>/gamemode/**` and types the `GM` global as the class `gamemode_<name>`. This lets `DEFINE_BASECLASS("gamemode_sandbox")` and cross-gamemode field access, such as `self.Sandbox.SetupMove`, resolve in derived gamemodes.

To change a built-in definition, add an entry with its `id` and only the fields you want to change. To turn off a built-in group, set `{ "id": "effects", "disabled": true }`.

### Example

```json .gluarc.json theme={null}
{
  "gmod": {
    "scriptedClassScopes": {
      "include": [
        {
          "id": "plugins",
          "scaffold": {
            "files": [{ "path": "{{name}}/sh_plugin.lua", "template": "plugin_sh.lua" }]
          }
        },
        {
          "id": "effects",
          "disabled": true
        },
        {
          "id": "my-controllers",
          "label": "Controllers",
          "classGlobal": "CTRL",
          "path": ["lua", "controllers"],
          "include": ["lua/controllers/**"],
          "rootDir": "lua/controllers",
          "scaffold": {
            "files": [{ "path": "{{name}}.lua", "template": "controller.lua" }]
          }
        }
      ]
    }
  }
}
```

***

## Hooks

| Option                             | Type       | Default | Description                                                  |
| ---------------------------------- | ---------- | ------- | ------------------------------------------------------------ |
| `gmod.hookMappings.methodToHook`   | `object`   | `{}`    | Map method names to hook names (e.g. `{ "Think": "Think" }`) |
| `gmod.hookMappings.emitterToHook`  | `object`   | `{}`    | Map custom emitter functions to hook names                   |
| `gmod.hookMappings.methodPrefixes` | `string[]` | `[]`    | Additional method name prefixes for auto hook detection      |

***

## Network analysis

| Option                                         | Type      | Default | Description                                                              |
| ---------------------------------------------- | --------- | ------- | ------------------------------------------------------------------------ |
| `gmod.network.enabled`                         | `boolean` | `true`  | Enable all network flow analysis                                         |
| `gmod.network.completion.smartReadSuggestions` | `boolean` | `true`  | Suggest net.Read\* calls in expected order inside receive callbacks      |
| `gmod.network.codeLensEnabled`                 | `boolean` | `true`  | Show code lens actions on net message receivers                          |
| `gmod.network.completion.mismatchHints`        | `boolean` | `true`  | Annotate suggestions with hints when expected read doesn't match current |

<Note>
  To disable individual network diagnostics, use the primary `diagnostics.disable` list with the relevant code name (e.g. `"gmod-net-read-write-type-mismatch"`). See the [Diagnostics configuration](/configuration/diagnostics) page for the full list of network diagnostic codes and severity options.
</Note>

### Example

```json .gluarc.json theme={null}
{
  "gmod": {
    "network": {
      "enabled": true
    }
  },
  "diagnostics": {
    "disable": ["gmod-net-read-write-bits-mismatch"]
  }
}
```

***

## VGUI

| Option                       | Type      | Default | Description                                       |
| ---------------------------- | --------- | ------- | ------------------------------------------------- |
| `gmod.vgui.codeLensEnabled`  | `boolean` | `true`  | Show code lens actions on `vgui.Register()` calls |
| `gmod.vgui.inlayHintEnabled` | `boolean` | `false` | Show inlay hints for VGUI panel types             |

***

## Outline verbosity

`gmod.outline.verbosity` controls what appears in the **Outline** view for Lua files:

| Value                | Behavior                                                           |
| -------------------- | ------------------------------------------------------------------ |
| `"minimal"`          | Functions, classes, hooks, net receivers, timers, concommands only |
| `"normal"` (default) | Same as minimal, plus typed non-primitive tables and variables     |
| `"verbose"`          | All locals, assignments, and code blocks                           |

***

## VS Code extension settings

You can also configure these settings in VS Code settings with the `gluals.*` prefix:

| VS Code setting                      | .gluarc.json key              | Type                                       | Default                             | Description                                                                            |
| ------------------------------------ | ----------------------------- | ------------------------------------------ | ----------------------------------- | -------------------------------------------------------------------------------------- |
| `gluals.gmod.autoLoadAnnotations`    | `gmod.autoLoadAnnotations`    | `boolean` (`boolean \| null` in workspace) | `true` (`null` in workspace)        | Auto-download Garry's Mod annotations                                                  |
| `gluals.gmod.annotationsRepository`  | VS Code only                  | `string`                                   | `Pollux12/annotations-gmod-glua-ls` | GitHub repository for automatic annotation downloads                                   |
| `gluals.gmod.annotationsChannel`     | VS Code only                  | `auto \| stable \| prerelease`             | `auto`                              | Annotation channel. `auto` follows the extension build                                 |
| `gluals.gmod.annotationsBranch`      | VS Code only                  | `string`                                   | `gluals-annotations`                | Advanced setting for downloading from a specific branch                                |
| `gluals.gmod.annotationsCommit`      | VS Code only                  | `string`                                   | `""`                                | Advanced setting for downloading one exact commit hash; stops annotation update checks |
| `gluals.gmod.autoDetectGamemodeBase` | `gmod.autoDetectGamemodeBase` | `boolean \| null`                          | `null` (enabled)                    | Auto-detect base gamemodes from the gamemode `.txt` file                               |
| `gluals.gmod.templatePath`           | `gmod.templatePath`           | `string`                                   | `null`                              | Custom scaffolding template path                                                       |
| `gluals.gmod.vgui.codeLensEnabled`   | `gmod.vgui.codeLensEnabled`   | `boolean`                                  | `true`                              | VGUI code lens                                                                         |
| `gluals.gmod.vgui.inlayHintEnabled`  | `gmod.vgui.inlayHintEnabled`  | `boolean`                                  | `false`                             | VGUI inlay hints                                                                       |
