@adiffx
Personal projects and tools

Ren'Py Magic for VSCode

A Visual Studio Code extension that adds rich language support for the Ren’Py visual novel engine.

I originally made this for myself after running into a few small annoyances with existing extensions — mainly wanting to jump to labels in current file, check whether an image reference actually exists, and jump to image definitions with F12.

I kept adding things as I needed them while working on projects, and over time it just grew into something more complete. It’s still very much shaped by what I personally find useful, but it might be helpful to others too. It's powered by a proper language server (LSP), which makes features like navigation, diagnostics, and completions more consistent and reliable.

🚀 Installation

Install Ren'Py Magic from VSCode Marketplace

Or search for "Ren'Py Magic" in your Visual Studio Code Extension tab.

✨ Features

🎨 Syntax Highlighting

📖 Hover Documentation

Category Examples
config.* config.name, config.screen_width
gui.* gui.text_color, gui.show_name
build.* build.name, build.directory_name
Actions Jump, Call, Show, Hide
Style properties background, padding, color
Transform properties xpos, ypos, zoom, alpha

Also includes:

Image preview

Image preview on hover — hover over show or scene statements to see a preview of the referenced sprite, scene or CG.

 

Audio & video preview

Hover over play music|sound|voice|audio <name> (or queue ...) statements, or over the <name> part of a define audio.<name> = "..." line, to see the resolved file with a play link. Audio opens in VS Code's built-in player; video opens in the OS's default app, since VS Code's viewer can't decode WebM and other Ren'Py-friendly formats.

 

🔎 Navigation & Code Intelligence

Go to Symbol (Cmd+Shift+O / Ctrl+Shift+O)

Jump to:

Workspace Symbol Search (Cmd+T / Ctrl+T)

Search across all .rpy files:

Go to Definition (F12)

Navigate directly to definitions of:

✔ Handles Ren’Py’s flexible image naming (space-separated names)

🔁 Refactoring Tools

Find All References (Shift+F12)

Rename Symbol (F2)

⚡ Intelligent Completions

 

Context-aware suggestions for:

✍️ Signature Help

Inline parameter hints for 60+ functions, including:

⚠️ Diagnostics

Real-time feedback with:

Warnings

Errors

🛠 Development

git clone https://github.com/adiffx/renpy-magic.git
cd renpy-magic
npm install
npm run compile

Then press F5 in VS Code to launch the Extension Development Host.

Running Tests

npm test

Updating API Data

npm run fetch-api
npm run compile

This pulls documentation from Ren’Py source and RST files, generating:

src/server/renpy-api.json

⚙️ Settings

Setting Default Description
renpyMagic.diagnostics.warnUndefinedImages false Warn when show/scene references an image not defined in code. Disabled by default because images are often defined as files rather than in code.
renpyMagic.renpySdkPath "" Path to the Ren'Py SDK folder. When set, enables native Ren'Py lint for more accurate error detection.
renpyMagic.lint.enabled false Enable native Ren'Py lint integration. Requires renpySdkPath to be set.
renpyMagic.lint.onSave true Run Ren'Py lint automatically on file save.

Native Ren'Py Lint (Optional)

For more accurate error detection, you can enable native Ren'Py lint integration:

  1. Download the Ren'Py SDK
  2. Set renpyMagic.renpySdkPath to the SDK folder path (e.g., /Applications/renpy-8.3.0-sdk)
  3. Enable renpyMagic.lint.enabled

When enabled, the extension will run Ren'Py's native lint tool on save, providing errors and warnings from the actual compiler alongside the built-in diagnostics.

⚠️ Known Limitations

📋 Requirements

📄 License

MIT