Language support for the Adventure Game Studio Scripting Language in Visual Studio Code — syntax highlighting, completions with snippets, and rich hovers that link to the official manual.
- Syntax highlighting for .asc and .ash
- Completions for global functions, methods, and properties across core APIs, plus snippets with tabstops
- Quick Info / Hover with signatures, short descriptions, and a direct Open manual link
- Data-driven API, editable via
data/ags-api.json
Supported areas include Game, Screen, Camera, Viewport, Character, DynamicSprite, DrawingSurface,
Mouse, GUI/GUIControl (Button, Label, ListBox, Slider, TextBox), InventoryItem, Overlay, Room, Object,
Hotspot, Region, System — and more can be added at any time.
The extension activates for the language id
agsscriptwhen opening .asc or .ash files.
- Visual Studio Code
- Node.js 18+ and npm
npm ci
npm run compilePress F5 to launch the Extension Development Host, open an .asc or .ash file, and try typing Display(, Game., or player.Walk(.
# optional: install the VS Code packaging tool
npm i -g @vscode/vsce
# compile first
npm run compile
# Windows PowerShell only, if script execution is blocked:
# Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
# create the .vsix package
vsce package
You can then install the generated .vsix from VS Code via Extensions → … menu → Install from VSIX….
.
├─ assets/
│ └─ logo.png # logo for extension
├─ data/
│ └─ ags-api.json # API entries for completion & hover
├─ src/
│ ├─ api.ts # loader + helpers for completions and hovers
│ ├─ extension.ts # registers providers for 'agsscript'
│ └─ types.ts # minimal shared types
├─ syntaxes/
│ └─ ags.tmLanguage.json # TextMate grammar with enum member highlighting
├─ dist/ # compiled JS output (tsc)
├─ package.json
├─ tsconfig.json
└─ README.md
The completion and hover info are defined in data/ags-api.json. Each entry looks like:
{
"label": "Character.Walk",
"insertText": "Walk(${1:x}, ${2:y}${3:, ${4:blocking}}${5:, ${6:walkWhere}});",
"detail": "Character.Walk(int x, int y, optional BlockingStyle, optional WalkWhere)",
"documentation": "Walks with animation to coordinates.",
"url": "https://adventuregamestudio.github.io/ags-manual/Character.html#characterwalk",
"kind": "Method",
"receiver": "Character"
}label: name shown in completioninsertText: snippet with${n}tabstopsdetail: signature for quick infodocumentation: short, factual descriptionurlorlink: manual pagekind:Function,Method, orPropertyreceiver: class name for methods and properties