VSCode extension (recommended)
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
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.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.Let the extension initialize
On first launch, the extension:
- Downloads the language server binary
- Downloads the latest GMod wiki annotations
- Sets up the
.gluarc.jsonconfiguration file if needed
Workspace structure
GLuaLS works best when each workspace folder contains one addon or gamemode. The extension detects the structure and configures itself. Expected structure:garrysmod
addons
my-addon <- Workspace Root
lua
addon.json
...
gamemodes
my-gamemode <- Workspace Root
gamemode
...
garrysmod/ folder.
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/
my-addon-1
lua
addon.json
...
my-addon-2
lua
addon.json
...
my-gamemode
gamemode
...
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+Spaceto 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
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
glua_ls binary. Most editors accept a cmd or command setting in their LSP configuration.
Build from source
target/release/glua_ls (or glua_ls.exe on Windows).
Standalone LSP Server Configuration
When you runglua_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.gmod.annotationsPathin.gluarc.json(highest priority)--gmod-annotations-pathCLI flag- VSCode extension provided path (if running via VSCode)