Repository navigation
Senpy v0.3.0 — Flow-Sensitive Dataflow, Native VS Code Outline, 40 Semantic Rules & Full F12 Navigation
This major milestone release elevates Senpy to 40 semantic rules (up from 29), introduces flow-sensitive branching analysis across if/elif/else blocks, brings native VS Code Document Symbols & Outline support, bundles instant hover documentation for 220+ Ren'Py Engine APIs, and supercharges Go-to-Definition (F12) across variables, sprites, and media files.
What's New in v0.3.0
1. Native VS Code Outline & Breadcrumbs (Ctrl+Shift+O)
- Document Symbols Provider: Your
.rpyscripts now feature a rich, interactive outline tree in the Outline (Структура) panel and editor Breadcrumbs. - Instantly navigate between
label,screen,layeredimage,image, and globaldefine/defaultdeclarations. - Use
Ctrl+Shift+O(orCmd+Shift+Oon macOS) for fuzzy quick-jump navigation across scenes in files with thousands of lines.
2. Flow-Sensitive Branching Analysis (if / elif / else & menu)
- Tracks variable definedness across branching control-flow paths without requiring whole-program execution.
- Catches variables in
MAYBE_SETstate (RPY404) that are defined in anifbranch but omitted inelseor alternative paths, preventing runtimeNameErrorand save-game corruptions. - Accurately recognizes terminal branches (
jump/return) and guaranteed definitions without false positives.
3. Instant Hover Documentation for 220+ Ren'Py Engine APIs
- Hovering over any built-in Ren'Py function (
renpy.pause,renpy.jump,renpy.music.*,renpy.random.*) or Screen Action (SetVariable,Function,Return,ShowMenu,ToggleField, etc.) now shows a rich Markdown card with parameters, signatures, gotchas, examples, and documentation links. - 100% Offline & Instant (~0.1ms): Does not query external APIs at runtime or lag your editor.
- Includes
scripts/update_renpy_api.pyto automatically sync definitions from upstream Ren'Py releases without installing the Ren'Py SDK.
4. Full-Spectrum Go-to-Definition (F12)
Pressing F12 / Ctrl+Click now resolves:
- Story labels & Screens: Jump straight to
labelorscreendeclarations. - Variables & Characters: Jump to
defaultanddefinestatements (e.g.define e = Character(...)). - Sprites & Backgrounds: Jump to
imageorlayeredimagecode definitions. - Media Assets on Disk: Jump directly to physical
.png,.webp,.ogg, and.mp3files in your workspace!
11 New Semantic Rules (29 ➔ 40 Rules Total)
| Code | Category | Severity | Description |
|---|---|---|---|
RPY107 |
State & APIs | HINT |
Deprecated Ren'Py API: Detects obsolete functions (LiveComposite, DynamicCharacter, im.*, ui.*) with 1-click QuickFix replacement. |
RPY108 |
Variables & State | ERROR / WARNING |
Type Taint Conflict: Flags fatal runtime TypeError on illegal augmented operations (str += int) and conflicting type reassignments. |
RPY109 |
Init Graph | ERROR |
Init Phase Dependency Violation: Detects functions evaluated in init python: before their declaring file loads in alphabetical order. |
RPY207 |
Screens & UI | ERROR |
Screen Parameter Mismatch: Validates argument counts and keyword parameters on use screen(...) and call screen(...). |
RPY309 |
Story Flow | WARNING |
Story Island / Subgraph Loop: Detects isolated groups of scenes referencing each other in loops but unreachable from start or system entry points. |
RPY310 |
Story Flow | ERROR |
Call Arity Violation: Catches missing required positional arguments or unexpected keyword parameters on call label(...). |
RPY404 |
Branching & Logic | WARNING |
MAYBE_SET Variable Read: Flags condition checks (if var:) or text interpolations ([var]) evaluated on variables only defined in certain branches. |
RPY505 |
Assets & Media | WARNING / ERROR |
Unregistered Audio Channel: Flags playback on unregistered audio channels and prevents audio overlap glitches from loop on voice. |
RPY601 |
Translations | ERROR |
Variable Mismatch in Translations: Catches altered or misspelled [var] tags in game/tl/ before they crash with KeyError. |
RPY602 |
Translations | WARNING |
Formatting Tag Mismatch: Detects lost or altered {b}, {color}, {i} tags between original and translated strings. |
RPY603 |
Translations | WARNING |
Empty Translation String: Detects blank new "" strings in localization files that leave player dialogue windows empty. |
Additional CLI & Tooling Upgrades
- Translation Coverage (
senpy --coverage): Auditsgame/tl/and calculates localization progress percentages per language. - GDD Wiki Generator (
senpy --export-wiki): Automatically extracts cast lists, typed variables, and story endings into a Markdown game design document. - Type Stubs (
senpy --stubs): Generates.pyitype stubs for the Ren'Py store, giving Pylance / MyPy in VS Code native autocompletion. - Crash Inspector (
senpy --traceback): Parses post-mortemtraceback.txtcrash logs and maps errors to actionable Senpy rules. - One-Click GitHub Actions (
senpy --init-ci): Generates automated pull-request scanning workflows with native GitHub CodeQL SARIF alerts. - Cache Integrity: Hardened Tier 2
.senpy_cacheinvalidation by hashing variable types, asset tags, and registered channels. - Bugfixes: Fixed CLI argument parsing for
--defaultsand--stubs, isolated local label parameters from global namespace leakage, and preventedcall screenfrom registering phantom jump targets.
Installation & Updating
Core Python Analyzer (CLI & LSP):
pip install --upgrade senpy-linterVS Code Extension:
Download senpy-vscode-0.3.0.vsix from the Assets below and install via Install from VSIX... in VS Code.