Overview
All GMod-specific settings live under thegmod key in .gluarc.json. These settings control realm detection, network message analysis, scripted class behavior, VGUI support, and more.
Top-level options
| Option | Type | Default | Description |
|---|---|---|---|
gmod.enabled | boolean | true | Enable all GMod-specific analysis. Set false to use as a generic Lua LS |
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, and require |
gmod.inferDynamicFields | boolean | true | Track fields dynamically assigned to GMod 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 | Parameter-name → type fallback, applied to params without explicit @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 GMod annotation .lua files. When null, the VSCode extension’s auto-downloaded annotations are used |
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, plugins, gamemodes.
Each definition supports:
| Field | Type | Description |
|---|---|---|
id | string | Stable key for overrides or removal |
label | string | Display name in Class Explorer and Settings UI |
classGlobal | string | Global variable the class uses (ENT, SWEP, etc.) |
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) |
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 override a built-in definition, add an entry with its id and only the fields you want to change. To disable a built-in group, set { "id": "effects", "disabled": true }.
Example
.gluarc.json
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 |
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 page for the full list of network diagnostic codes and severity options.Example
.gluarc.json
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" | Full legacy view with all locals, assignments, and control-flow blocks |
VSCode extension settings
You can also configure these settings in VS Code settings with thegluals.* prefix:
| VSCode Setting | .gluarc.json Key | Type | Default | Description |
|---|---|---|---|---|
gluals.gmod.autoLoadAnnotations | gmod.autoLoadAnnotations | boolean (boolean | null in workspace) | true (null in workspace) | Auto-download GMod annotations |
gluals.gmod.annotationsRepository | VS Code only | string | Pollux12/annotations-gmod-glua-ls | GitHub repository for automatic annotation downloads |
gluals.gmod.annotationsBranch | VS Code only | string | gluals-annotations | Git branch for automatic annotation downloads |
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.network.codeLensEnabled | gmod.network.codeLensEnabled | boolean | true | Network code lens |
gluals.gmod.vgui.codeLensEnabled | gmod.vgui.codeLensEnabled | boolean | true | VGUI code lens |
gluals.gmod.vgui.inlayHintEnabled | gmod.vgui.inlayHintEnabled | boolean | false | VGUI inlay hints |