Skip to content

undervolta/scaffscript-vscode

Repository files navigation

ScaffScript

ScaffScript is a minimal superset of GML (GameMaker Language) that adds a TypeScript-like module system. Write organized, modular GML in .scaff files. ScaffScript compiles to GML and can inject it directly into your GameMaker project. Check out the official documentation for more information.

This extension provides language support for .scaff files inside Visual Studio Code.

DISCLAIMER: ScaffScript is not affiliated with or endorsed by YoYo Games Ltd. GameMaker and GML are trademarks of YoYo Games Ltd. This is an independent community effort.

Features

Full syntax highlighting for .scaff (ScaffScript) files, covering:

  • Module system keywords

    export, import, include, intg, from, to, as, export ... from.

  • GML & control flow keywords

    if, else, for, while, return, switch, try, catch, and more.

  • Storage types

    var, let, const, function, class, interface, enum, type, extends.

  • Content directives

    @content, @valueof, @typeof, @nameof, @use, and inline aliases (@:name).

  • Integration blocks

    #[blockName], #[blockName as EventType], #[EventType:EventSubtype Event], flags after --.

  • Classes, interfaces, enums, and types, with proper scope colorization.

  • Strings

    Double-quoted, single-quoted, template literals (`), GML template strings ($"..."), and raw strings (@"...").

  • Comments

    // line comments and /* */ block comments.

Module Exports

Code Generation & Integration

Command Palette

Additional editor niceties:

  • Command palette to run scaff generate.
  • Auto-closing pairs for {}, [], (), "", '', and ``.
  • Bracket matching and surrounding pairs.
  • Smart indentation rules.

Installation

From the VS Code Marketplace

  1. Open VS Code.
  2. Go to the Extensions panel (Ctrl+Shift+X / Cmd+Shift+X).
  3. Search for ScaffScript.
  4. Click Install.

From a VSIX file

  1. Download the .vsix file from the Releases page.
  2. In VS Code, open the Command Palette (Ctrl+Shift+P / Cmd+Shift+P).
  3. Run Extensions: Install from VSIX….
  4. Select the downloaded .vsix file.

Usage

Once installed, any file with a .scaff extension will automatically be recognized as ScaffScript and syntax highlighting will activate.

Here's a quick taste of what ScaffScript looks like:

// src/index.scaff
intg { main } to "./scripts/Libraries/MyLib"

import * from "./utils"

#[main]
include { helper } from "./helpers"
@content helper

export function myLib_get(key) {
    return helper(key);
}

For a full guide on the ScaffScript language itself, check out the official documentation.

Limitations

  • Syntax highlighting only

    There's no IntelliSense, code completion, hover info, go-to-definition, or error diagnostics yet. This extension is purely a grammar/language definition for now.

  • Regex-based parser

    ScaffScript's compiler uses a regex-based parser (not an AST), so nested code blocks (e.g. nested struct literals in @use directives) and some edge cases may not parse correctly.

  • GameMaker 2.3+ only

    ScaffScript is designed and tested for GameMaker 2.3+. It may or may not work with GameMaker 1.x.

  • Early development

    ScaffScript API is subject to change without notice. Use at your own risk.

Issues

Found a bug or want to request a feature? Open an issue on the GitHub repository.

When reporting a bug, please include:

  • Your VS Code version.
  • The extension version.
  • A minimal code snippet that reproduces the issue.
  • A screenshot or description of what you expected vs what happened.

More Info