Skip to main content

Overview

All GMod-specific settings live under the gmod key in .gluarc.json. These settings control realm detection, network message analysis, scripted class behavior, VGUI support, and more.

Top-level options

OptionTypeDefaultDescription
gmod.enabledbooleantrueEnable all GMod-specific analysis. Set false to use as a generic Lua LS
gmod.defaultRealmstring"shared"Realm assumed for files with no realm signal. Use "client", "server", or "shared"
gmod.detectRealmFromFilenameboolean | nullnull (resolves to true)Detect realm from cl_, sv_, sh_ filename prefixes and /client/, /server/ parent directories
gmod.detectRealmFromCallsboolean | nullnull (resolves to true)Infer realm from calls like include, AddCSLuaFile, IncludeCS, and require
gmod.inferDynamicFieldsbooleantrueTrack fields dynamically assigned to GMod objects
gmod.dynamicFieldsGlobalbooleantrueShare inferred dynamic fields across all files. Set false to scope them per-file
gmod.fileParamDefaultsobjectbuilt-in mapParameter-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

OptionTypeDefaultDescription
gmod.annotationsPathstring | nullnullCustom path to GMod annotation .lua files. When null, the VSCode extension’s auto-downloaded annotations are used
gmod.autoLoadAnnotationsboolean | nullnullOverride workspace annotation auto-loading. Set false to disable even if the extension or CLI provides annotations

Scaffolding

OptionTypeDefaultDescription
gmod.templatePathstring | nullnullPath 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.
OptionTypeDefaultDescription
gmod.autoDetectGamemodeBaseboolean | nullnull (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:
FieldTypeDescription
idstringStable key for overrides or removal
labelstringDisplay name in Class Explorer and Settings UI
classGlobalstringGlobal variable the class uses (ENT, SWEP, etc.)
pathstring[]Path segments to detect class from file path
includestring[]Glob patterns for files to analyse
excludestring[]Optional per-definition exclude globs
parentIdstringParent definition ID for nested grouping in Explorer
iconstringVS Code icon ID for Class Explorer display
rootDirstringDefault root used by the scaffold action
scaffold.filesarrayScaffold output entries: { path, template } with {{name}} variable
classNamePrefixstringOptional prefix prepended to the folder-derived class name. Used by the gamemodes scope to produce runtime-accurate names like gamemode_sandbox
disabledbooleanDisable 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 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
{
  "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

OptionTypeDefaultDescription
gmod.hookMappings.methodToHookobject{}Map method names to hook names (e.g. { "Think": "Think" })
gmod.hookMappings.emitterToHookobject{}Map custom emitter functions to hook names
gmod.hookMappings.methodPrefixesstring[][]Additional method name prefixes for auto hook detection

Network analysis

OptionTypeDefaultDescription
gmod.network.enabledbooleantrueEnable all network flow analysis
gmod.network.completion.smartReadSuggestionsbooleantrueSuggest net.Read* calls in expected order inside receive callbacks
gmod.network.codeLensEnabledbooleantrueShow code lens actions on net message receivers
gmod.network.completion.mismatchHintsbooleantrueAnnotate 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
{
  "gmod": {
    "network": {
      "enabled": true
    }
  },
  "diagnostics": {
    "disable": ["gmod-net-read-write-bits-mismatch"]
  }
}

VGUI

OptionTypeDefaultDescription
gmod.vgui.codeLensEnabledbooleantrueShow code lens actions on vgui.Register() calls
gmod.vgui.inlayHintEnabledbooleanfalseShow inlay hints for VGUI panel types

Outline verbosity

gmod.outline.verbosity controls what appears in the Outline view for Lua files:
ValueBehavior
"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 the gluals.* prefix:
VSCode Setting.gluarc.json KeyTypeDefaultDescription
gluals.gmod.autoLoadAnnotationsgmod.autoLoadAnnotationsboolean (boolean | null in workspace)true (null in workspace)Auto-download GMod annotations
gluals.gmod.annotationsRepositoryVS Code onlystringPollux12/annotations-gmod-glua-lsGitHub repository for automatic annotation downloads
gluals.gmod.annotationsBranchVS Code onlystringgluals-annotationsGit branch for automatic annotation downloads
gluals.gmod.autoDetectGamemodeBasegmod.autoDetectGamemodeBaseboolean | nullnull (enabled)Auto-detect base gamemodes from the gamemode .txt file
gluals.gmod.templatePathgmod.templatePathstringnullCustom scaffolding template path
gluals.gmod.network.codeLensEnabledgmod.network.codeLensEnabledbooleantrueNetwork code lens
gluals.gmod.vgui.codeLensEnabledgmod.vgui.codeLensEnabledbooleantrueVGUI code lens
gluals.gmod.vgui.inlayHintEnabledgmod.vgui.inlayHintEnabledbooleanfalseVGUI inlay hints