Rive for VS Code
Diagnostics for Rive projects (a folder with a rive.yaml), covering
RML, Luau and WGSL
sources, plus experimental
AssemblyScript support. The extension is a
thin client: analysis runs in rive-cli's language server,
so problems always match what rive --verify and the build report.
Requires rive-cli on your PATH, or set rive.path.
Debugging scripts
Press F5 in a project to run it in the rive preview with the Luau debugger
attached: breakpoints, stepping, the call stack, locals and upvalues, hover
to inspect, and script errors pausing where they were raised. Console output
lands in the Debug Console. Every rebuild keeps the session and re-plants the
breakpoints in the new build.
Two configurations are contributed for launch.json:
{ "type": "rive", "request": "launch", "name": "Rive: preview",
"projectDir": "${workspaceFolder}", "args": ["--serve"] }
{ "type": "rive", "request": "attach", "name": "Rive: attach to preview",
"port": 9641 }
Launch opens a terminal running rive <projectDir> --debug=<port> with any
extra args and attaches once the preview is listening; the terminal stays,
since the preview logs to it and reads commands from it. Attach expects a
preview you started yourself with rive --debug (or --debug=<port>). The
preview window freezes while paused, as the scripts run on its thread.
rive docs debugging has the full picture.
Development
npm install
npm run build # bundle dist/extension.js
npm run typecheck
Launch with F5 from this folder, and set rive.path to a local
out/debug/rive_cli build to run against a working-copy server.
npm test runs the extension against a downloaded VS Code with a throwaway
project. From a terminal inside VS Code, unset ELECTRON_RUN_AS_NODE first or
the spawned instance runs as plain node.