VSCode Extension
This content is for v0.7. Switch to the latest version for up-to-date documentation.
Use the Resonon VSCode extension for live coding with syntax highlighting, error diagnostics, and integrated output.
Quick Start
Section titled “Quick Start”1. Start the Server
Section titled “1. Start the Server”resonon serverOutput:
[server] Listening on 0.0.0.0:55552. Connect from VSCode
Section titled “2. Connect from VSCode”- Open a
.nonfile in VSCode (with the Resonon extension installed) - Click “RESONON” in the status bar (bottom-right), or run RESONON: Connect to Server
- Status changes to “RESONON” when connected
3. Run Code
Section titled “3. Run Code”Select code and press Cmd+Enter (macOS) or Ctrl+Enter (Windows/Linux).
Server Options
Section titled “Server Options”resonon server # Start with defaults (0.0.0.0:5555)resonon server --server-port 8080 # Custom portresonon server --server-host 127.0.0.1 # Localhost only (more secure)| Option | Default | Description |
|---|---|---|
--server-host | 0.0.0.0 | Address to bind to |
--server-port | 5555 | Port to listen on |
-m, --midi-port | - | Connect to MIDI port on startup |
--no-midi | - | Disable MIDI output |
Examples
Section titled “Examples”# Server with MIDIresonon server --midi-port "IAC Driver Bus 1"
# Localhost only (more secure)resonon server --server-host 127.0.0.1Extension Installation
Section titled “Extension Installation”- Open VSCode
- Go to Extensions (Cmd+Shift+X)
- Search “RESONON”
- Install the extension
Settings
Section titled “Settings”Configure the extension in VSCode’s settings (Cmd+, or File > Preferences > Settings) under RESONON.
| Setting | Default | Description |
|---|---|---|
resonon.server.path | "" | Path to resonon binary. If empty, searches PATH. Set this if resonon is not on your PATH. |
resonon.server.port | 5555 | WebSocket server port used when spawning a server from VSCode. |
resonon.lsp.enabled | true | Enable LSP language features (hover, completion, go to definition). Disable if you only want evaluation without editor intelligence. |
resonon.lsp.path | "" | Path to resonon-lsp binary. If empty, uses the binary bundled with the extension. |
resonon.client.name | "" | Display name for multi-client sessions. If empty, uses your system username. |
Example settings.json:
{ "resonon.server.path": "/usr/local/bin/resonon", "resonon.client.name": "Alice"}Sidebar
Section titled “Sidebar”The RESONON sidebar (click the Resonon icon in the activity bar) provides quick access to server management and controls. It contains five views:
| View | Description |
|---|---|
| Servers | Lists all discovered, spawned, and manually added servers. Click to connect or set as active. |
| Server Controls | Start, stop, and restart the active server. |
| Transport | Play, pause, stop, and reset controls for the active server. |
| Evaluate | Buttons for evaluating the current selection or file. |
| Views | Open Console, Mixer, Routing, and MIDI Monitor panels. |
Servers in the list are labeled by origin:
- Discovered — found automatically via UDP broadcast on the local network
- Spawned — started from within VSCode using Start Server
- Manual — added by hand with Add Server…
Commands
Section titled “Commands”Connection
Section titled “Connection”| Command | Keybinding | Description |
|---|---|---|
| RESONON: Connect to Server | - | Auto-connect: uses active server, picks from available, or spawns a new one |
| RESONON: Disconnect from Server | - | Disconnect from the active server |
| RESONON: Connect to Server… | - | Connect to a specific server (sidebar context menu) |
| RESONON: Disconnect | - | Disconnect from a specific server (sidebar context menu) |
| RESONON: Set as Active Server | - | Set a connected server as the active target for evaluation |
| RESONON: Add Server… | - | Manually add a server by host and port |
| RESONON: Refresh Servers | - | Refresh the server list |
Server Management
Section titled “Server Management”| Command | Description |
|---|---|
| RESONON: Start Server | Start a local RESONON server and connect to it |
| RESONON: Stop Server | Stop the active server’s process |
| RESONON: Restart Server | Stop and re-start the active server |
Transport
Section titled “Transport”| Command | Keybinding | Description |
|---|---|---|
| RESONON: Play / Pause | F5 | Toggle playback on the active server |
| RESONON: Stop | Shift+F5 | Stop playback and reset position |
| RESONON: Reset | Ctrl+Shift+F5 | Reset the server session state |
Evaluation
Section titled “Evaluation”| Command | Keybinding | Description |
|---|---|---|
| RESONON: Evaluate Selection or Line | Cmd+Enter / Ctrl+Enter | Run selected code or the current line |
| RESONON: Evaluate File | - | Run the entire file |
| Command | Description |
|---|---|
| RESONON: Open Console | Open the server console in an integrated terminal |
| RESONON: Open Mixer | Open the mixer view |
| RESONON: Open Routing | Open the routing view |
| RESONON: Open MIDI Monitor | Open the MIDI monitor view |
| Command | Description |
|---|---|
| RESONON: Toggle Output Filter (Own / All) | Switch between showing your own output or all clients’ output |
| RESONON: Set Display Name | Set your display name for multi-client sessions |
Transport Controls
Section titled “Transport Controls”The transport keybindings provide quick control over playback without leaving the editor:
| Key | Action |
|---|---|
| F5 | Play / Pause — toggles playback |
| Shift+F5 | Stop — stops playback and resets position |
| Ctrl+Shift+F5 | Reset — resets the entire server session |
These keybindings are only active when a .non file is focused. They send the equivalent of PLAY;, PAUSE;, and STOP; commands to the active server.
Status Bar
Section titled “Status Bar”The status bar shows connection state and server info:
| Icon | State | Click Action |
|---|---|---|
$(circle-slash) RESONON | Disconnected | Connect to server |
$(sync~spin) RESONON | Connecting… | — |
$(circle-filled) RESONON: ServerName (as You) | Connected | Open server menu |
$(sync~spin) RESONON | Reconnecting… | — |
When connected, the status bar shows the server name and your display name (e.g. RESONON: Studio (as Alice)). Clicking the connected status bar opens a quick-pick menu to disconnect or stop the server.
A second status bar item shows LSP state:
| Icon | State |
|---|---|
$(sync~spin) LSP | Starting |
$(check) LSP | Running |
$(circle-slash) LSP | Stopped |
$(error) LSP | Error (hover for details) |
Language Server (LSP)
Section titled “Language Server (LSP)”The extension includes a built-in language server that provides editor intelligence for .non files. The LSP starts automatically when you open a Resonon file (unless disabled via resonon.lsp.enabled).
Hover Documentation
Section titled “Hover Documentation”Hover over any symbol to see its type, signature, and documentation. This works for:
- Variables and their inferred types
- Functions and their parameter signatures
- Built-in classes, methods, and constructors
- Module members (e.g.
MyModule.some_function)
Code Completion
Section titled “Code Completion”Start typing to get completions for keywords and known symbols. Completions also trigger after a dot (.) for method calls — the LSP infers the receiver type and suggests available methods.
Go to Definition
Section titled “Go to Definition”Cmd+Click (or F12) on a symbol to jump to its definition. Works for variables, functions, and module members defined in your project.
Real-Time Diagnostics
Section titled “Real-Time Diagnostics”The LSP parses your code as you type and shows parse errors as red underlines, before you even evaluate. These are distinct from runtime errors returned by the server (see Error Diagnostics).
Error Diagnostics
Section titled “Error Diagnostics”There are two sources of error diagnostics:
LSP diagnostics — Parse errors detected as you type, before evaluation. These come from the built-in language server and appear immediately as red underlines.
Server diagnostics — Runtime errors returned after evaluating code (Cmd+Enter). These include type errors, undefined variables, and other issues that can only be detected at runtime.
Both types appear as:
- Red underlines at error locations
- Hover to see the error message
- Listed in the Problems panel (Cmd+Shift+M)
Server diagnostics clear when you evaluate new code. LSP diagnostics clear when you fix the parse error.
Output Panel
Section titled “Output Panel”View server output in VSCode’s Output panel:
- Open Output panel (View > Output or Cmd+Shift+U)
- Select “RESONON” from the dropdown
In multi-client sessions, use RESONON: Toggle Output Filter (Own / All) to switch between seeing only your own output or output from all connected clients.
Multi-Client Sessions
Section titled “Multi-Client Sessions”Multiple VSCode instances (or other clients) can connect to the same server simultaneously. All clients share the same session state — variables and patterns defined by one client are visible to all others.
Display Names
Section titled “Display Names”Each client is identified by a display name, shown in the status bar and output. Set your name via:
- The
resonon.client.namesetting - The RESONON: Set Display Name command
- If unset, your system username is used
Output Filtering
Section titled “Output Filtering”When multiple clients are connected, the output panel can get noisy. Use RESONON: Toggle Output Filter to switch between:
- Own — only output from your evaluations
- All — output from all connected clients
Use Cases
Section titled “Use Cases”- Collaborative live coding — multiple performers connected to one server
- Teaching — instructor and students share a session
- Multi-window — connect from multiple VSCode windows to build different parts of a piece
View Panels
Section titled “View Panels”The extension can open dedicated view panels as integrated terminals. Access them from the sidebar’s Views section or via commands.
| View | Command | Description |
|---|---|---|
| Console | RESONON: Open Console | Server console with output and keyboard shortcut hints |
| Mixer | RESONON: Open Mixer | Track levels and mixing controls |
| Routing | RESONON: Open Routing | MIDI and audio routing overview |
| MIDI Monitor | RESONON: Open MIDI Monitor | Real-time MIDI message display |
Console, Mixer, and Routing connect to the active server. The MIDI Monitor runs standalone and shows all MIDI activity on the system.
Session State
Section titled “Session State”The server maintains persistent state across executions:
// First executionlet melody = [C4 E4 G4];
// Second execution (melody still exists)melody << [B4 A4 G4]; // Works!State persists until the server restarts. This enables:
- Incremental development
- Live coding workflows
- Interactive debugging
Note: All connected clients share the same session state.
Live Coding Workflow
Section titled “Live Coding Workflow”A typical live coding session:
-
Start the server:
Terminal window resonon server --midi-port "IAC Driver Bus 1" -
Open your project in VSCode and connect
-
Iterate on patterns:
// Try a beatdrums << [bd sd bd sd];// Press F5 to start playback// Tweak it (Cmd+Enter to re-run)drums << [bd _ bd sd, ch*8]; -
Build up layers by running more code — previous definitions persist
-
Use F5 to toggle playback, Shift+F5 to stop
Troubleshooting
Section titled “Troubleshooting”Cannot Connect
Section titled “Cannot Connect”- Verify server is running:
resonon server - Check port isn’t in use:
lsof -i :5555 - Verify firewall allows connections
- Try explicit host:
resonon server --server-host 127.0.0.1
No Output
Section titled “No Output”- Ensure code uses
PRINTorPUTfor output - Check Output panel in VSCode (select “RESONON”)
- Verify connection is established (status bar shows connected)
Errors Not Showing
Section titled “Errors Not Showing”- Ensure you’re connected to server
- Check Problems panel in VSCode
- Try running
resonon serverwith a fresh start
Server Won’t Start
Section titled “Server Won’t Start”- Check if port is already in use
- Try a different port:
resonon server --server-port 5556 - Check for permission issues (binding to 0.0.0.0)
LSP Not Working
Section titled “LSP Not Working”- Check the LSP status bar item — if it shows an error, hover for details
- Verify
resonon.lsp.enabledistruein settings - If using a custom binary, check
resonon.lsp.pathpoints to a validresonon-lspexecutable - Check the Output panel — select “RESONON Language Server” for LSP logs
Server Discovery Not Finding Servers
Section titled “Server Discovery Not Finding Servers”- Servers must be on the same local network (UDP broadcast on port 5556)
- Firewalls may block UDP broadcast — check your firewall settings
- Use Add Server… to manually add a server by host and port as a fallback
See Also
Section titled “See Also”- Getting Started — Installation and first steps
- Configuration — Config files and setup scripts
- Troubleshooting — More troubleshooting tips