Skip to main content

Use the VS Code extension for GLuaLS setup. It handles:
  • downloads the language server binary
  • downloads GMod wiki annotations
  • installs server and client debugger (optional)
  • keeps these updated
1

Install from the marketplace

Search for GLua Language Server in the VS Code Extensions panel (Ctrl+Shift+X) or install directly from the Visual Studio Marketplace.
2

Open your project

Open your addon or gamemode folder in VS Code. The extension expects each workspace folder to be a single addon or gamemode root (the folder that directly contains lua/, addon.json, etc.).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 binary
  • Downloads the latest GMod wiki annotations
  • Sets up the .gluarc.json configuration file if needed
A notification in the bottom-right corner confirms when initialization is complete.If you want to set up the debugger, continue to Debugger setup.
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.

Workspace structure

GLuaLS works best when each workspace folder contains one addon or gamemode. The extension detects the structure and configures itself.
If you are working on a gamemode with multiple addons, add each addon as its own folder in a multi-root workspace instead of opening the whole garrysmod/ folder.
Expected structure:
garrysmod
addons
my-addon <- Workspace Root
lua
addon.json
...
gamemodes
my-gamemode <- Workspace Root
gamemode
...
Each VS Code workspace root should match one folder shown above. Use one root for the gamemode and one root per addon. For multiple addons, use a multi-root workspace instead of opening the whole garrysmod/ folder.
All folders within the multi-root workspace must be from the same game directory. Do not mix some folders from client and some from SRCDS.
For example, if you work on a gamemode with two addons, open each folder in VS Code as a separate workspace root. Your multi-root workspace would have three folders:
  • garrysmod/addons/my-addon-1/
  • garrysmod/addons/my-addon-2/
  • garrysmod/gamemodes/my-gamemode/
With this setup, your VS Code explorer should look like this:
my-addon-1
lua
addon.json
...
my-addon-2
lua
addon.json
...
my-gamemode
gamemode
...
If you use a multi-root workspace, set up the debugger for one folder. The same configuration works for the other folders in the same Garry’s Mod directory.

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 badges next to functions showing their client/server/shared status
  • Diagnostics as squiggly underlines for potential issues
Workspace indexing usually finishes in a few seconds after extension startup, even on larger projects.
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

Get started

Configure your workspace for the best GLuaLS experience.

Set up the debugger

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

Annotations

Improve type accuracy with EmmyLua and LuaCATS annotations.

Configuration reference

Reference all GLuaLS configuration options.

Explore features

Class Explorer

Browse scripted classes and jump to members.

Debugger

Attach, set breakpoints, and inspect live state.

AI integration

Runtime-aware Copilot/MCP enhancements.

Realm awareness

Detect client/server/shared code issues.

Network validation

Validate net.* send/receive flows.

Hook intelligence

Hook autocomplete and docs.

Scripted class support

Tools and generated helpers for ENT/SWEP/TOOL.

Code intelligence

Smart completion, jump-to-definition, and diagnostics for Lua & GMod APIs.

Other editors

GLuaLS works with any LSP-compatible editor, but advanced features like the debugger, Class Explorer, and settings UI are VS Code extension features.
Zed support is planned. It will have fewer features than the VS Code extension because Zed has a smaller extension API. Other editors are not planned.

Install the binary

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

Build from source

git clone https://github.com/Pollux12/gmod-glua-ls.git
cd gmod-glua-ls
cargo build --release
The binary is at target/release/glua_ls (or glua_ls.exe on Windows).

Standalone LSP Server Configuration

When you run glua_ls outside of the VS Code extension, specify the GMod annotations path with the --gmod-annotations-path flag:
glua_ls --gmod-annotations-path /path/to/gmod/annotations
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.
Precedence for annotations path:
  1. gmod.annotationsPath in .gluarc.json (highest priority)
  2. --gmod-annotations-path CLI flag
  3. VSCode extension provided path (if running via VSCode)
Example LSP client configuration (OpenCode/Neovim):
{
  "command": ["glua_ls", "--gmod-annotations-path", "/path/to/gmod/annotations"],
  "filetypes": ["lua"]
}