Skip to main content

Single addon or gamemode

Open the addon or gamemode folder directly in VS Code. The extension detects the structure from its path (garrysmod/addons/ or garrysmod/gamemodes/).
garrysmod
addons
my-addon <- Workspace Root
lua
addon.json
.gluarc.json
...
gamemodes
my-gamemode <- Workspace Root
gamemode
.gluarc.json
gamemode.txt
...

Multi-root workspaces

If you work on a gamemode and multiple addons, use a multi-root workspace and add each as its own folder. By default, GLuaLS analyzes all workspace folders together so your addons and gamemode can refer to one another. Enable workspace.enableIsolation only when you want each folder analyzed separately. See workspace configuration for details.
Do not open the entire garrysmod/ folder as your workspace root. GLuaLS expects each root to be an individual addon or gamemode, not the entire game directory.

Library paths

If your project uses shared utility files outside the workspace root, add them as library paths:
Use the settings menu instead of editing the JSON file directly. This helps you avoid config mistakes.
.gluarc.json
GLuaLS analyzes library files and makes their types available in your workspace. It does not report diagnostics for library files.

Ignoring files and folders

Ignore generated, vendored, or test files that should not affect editor results:
Use the settings menu instead of editing the JSON file directly. This helps you avoid config mistakes.
.gluarc.json

Custom require patterns

If your project uses a custom module loader, map it to require behavior:
Use the settings menu instead of editing the JSON file directly. This helps you avoid config mistakes.
.gluarc.json

Annotations path

By default, the VS Code extension downloads and updates Garry’s Mod wiki annotations. If you need a custom annotations build or want to turn off downloads:
Use the settings menu instead of editing the JSON file directly. This helps you avoid config mistakes.
.gluarc.json
See Annotations management for details on annotation downloads.

Next steps

Set up the debugger

Move from workspace setup to runtime debugging on SRCDS.

Debugger overview

See what breakpoints, stepping, inspection, and Lua execution can do.

Configuration overview

Tune GLuaLS behavior for your workspace.

Features overview

Browse the main language, debugger, realm, networking, and VGUI features.