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.
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. 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+Spaceto 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
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
Theglua_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
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 language 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- Path provided by the VS Code extension