Skip to main content

Overview

GLuaLS ships without bundled Garry’s Mod API definitions. The VS Code extension downloads the latest annotations generated from the Garry’s Mod wiki, so your API definitions stay current without extension updates.

How it works

On first launch and on later checks, the extension:
  1. Chooses which annotation branch to use
  2. Checks if that branch has a newer version
  3. Downloads annotations when they are missing or out of date
  4. Gives the annotation folder to the language server
VS Code stores annotations in global extension storage, separate from your project. All workspaces share them. GLuaLS loads these API definitions before other library folders. This lets framework and addon libraries use Garry’s Mod types and wrapper behavior correctly.

Annotation source

By default, the extension downloads annotations from Pollux12/annotations-gmod-glua-ls. Keep annotationsChannel set to auto for normal use. Stable extension builds use gluals-annotations. Pre-release extension builds use gluals-annotations-prerelease. You can change the repository, channel, branch, or commit hash in VS Code settings:
VS Code settings
If more than one setting is set, GLuaLS uses the first one in this list: custom local path, commit hash, branch, channel, extension build.

Manual update

To force an annotations update:
  1. Open the Command Palette (Ctrl+Shift+P)
  2. Run GLuaLS: Update GLuaLS Annotations

Disabling auto-download

If you need to use a custom annotations build or are in an environment without internet access:

Via VS Code settings

VS Code settings

Via .gluarc.json (per-workspace)

Use the settings menu instead of editing the JSON file directly. This helps you avoid config mistakes.
.gluarc.json

Using a custom annotations path

Point GLuaLS at your own annotations folder instead of the auto-downloaded ones:
.gluarc.json
The path can be absolute or relative to the workspace root. When you set annotationsPath, GLuaLS does not use the downloaded annotations for that workspace.
If gmod.annotationsPath is set, GLuaLS uses that folder for the workspace. Set gmod.autoLoadAnnotations: false in .gluarc.json to turn annotation auto-loading off for that workspace.

What the annotations contain

The annotations are generated from the official Garry’s Mod wiki and include:
  • All Garry’s Mod global functions with parameter types, return types, and descriptions
  • All class methods (Entity, Player, Weapon, etc.)
  • All enumerations
  • All hooks with parameter types
  • Realm badges indicating where each function is available
  • Metadata for wrappers, callbacks, and validity guards used by type checks