Skip to main content

Install the VS Code extension

The VS Code extension downloads and updates the language server and Garry’s Mod API definitions for you. It also includes the settings panel, Class Explorer, debugger, and runtime tools.
1

Install from the marketplace

Search for Garry’s Mod Language Server in the VS Code Extensions panel (Ctrl+Shift+X) or install it from the Visual Studio Marketplace.
2

Open your project

Open your addon or gamemode folder in VS Code. Use the folder that directly contains lua/, addon.json, or the gamemode files.For working on multiple addons at once, use a multi-root workspace.
3

Let the extension initialize

On first launch, the extension downloads the language server and Garry’s Mod API definitions. Wait for the GLuaLS status item to show that the server is running.
Do not install other Lua language server extensions alongside GLuaLS. Extensions such as EmmyLua, LuaLS, and GLua Enhanced will conflict. Create a dedicated VS Code profile for GMod development if you need other Lua tools for unrelated projects.

Choose the right folder

Open one addon or gamemode per workspace folder. If your project uses several addons, add each one to a multi-root workspace.
Do not open the whole garrysmod/ directory. It contains game files and unrelated addons that should not be part of your project analysis.
See Workspace setup for example layouts, libraries, and ignore rules.

Verify everything is working

Open any .lua file in your project. You should see:
  • Syntax highlighting with semantic token coloring
  • Autocomplete as you type (press Ctrl+Space to trigger manually)
  • Hover documentation when you hover over GMod API functions
  • Realm labels in GMod API hover and completion details
  • Diagnostics as squiggly underlines for potential issues
If you expected diagnostics but do not see any, check the Garry’s Mod Language Server section in the output panel for errors.

Next steps

Set up your workspace

Add shared libraries, ignore generated files, or configure a multi-root project.

Set up the debugger

Install gm_rdb and connect VS Code to a running SRCDS server.

Use the main features

Browse editor, Garry’s Mod, and debugger features.

Configuration

Change completion, diagnostics, formatting, and workspace settings.

Other editors

The glua_ls server can run in editors that support the Language Server Protocol. The debugger, Class Explorer, settings panel, and automatic downloads require the VS Code extension.

Install the binary

Point your LSP client to the glua_ls binary. Most editors accept a cmd or command setting in their LSP configuration.

Build from source

The binary is at target/release/glua_ls (or glua_ls.exe on Windows).

Standalone language server configuration

When you run glua_ls outside of the VS Code extension, specify the GMod annotations path with the --gmod-annotations-path flag:
The --gmod-annotations-path flag accepts a path to the folder containing the GMod API annotations. The VS Code extension usually downloads these files. Use none to disable annotation loading.
Annotation path priority:
  1. gmod.annotationsPath in .gluarc.json (highest priority)
  2. --gmod-annotations-path CLI flag
  3. Path provided by the VS Code extension
Example editor configuration: