Skip to content

BYTE-RANGER-Software/vscode-ags-extension

Repository files navigation

AGS Script Language Support (VS Code)

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.

Features

  • 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 agsscript when opening .asc or .ash files.

Requirements (to compile the source)

  • Visual Studio Code
  • Node.js 18+ and npm

Install from Source

npm ci
npm run compile

Press F5 to launch the Extension Development Host, open an .asc or .ash file, and try typing Display(, Game., or player.Walk(.

Build a VSIX Package

# 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….

Project Structure

.
├─ 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

Extend the API Data

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 completion
  • insertText: snippet with ${n} tabstops
  • detail: signature for quick info
  • documentation: short, factual description
  • url or link: manual page
  • kind: Function, Method, or Property
  • receiver: class name for methods and properties

About

Adventure Game Studio (AGS) scripting language support

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors