Connects VS Code to the Tough Round desktop app: opens the code a card points at, tells the app which code you are looking at, and previews change plans as diffs.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Connects VS Code (or Cursor) to the Tough Round desktop app, so the code
cards Tough Round shows during an interview work in your editor.
What it does
Opens the code a card points at. Press Open on a card in Tough Round and
the whole function is selected and highlighted here.
Knows what you are looking at. When you show your code in an interview,
"explain this" means the function your cursor is in. Only the file name and
line numbers are sent to the Tough Round app, never the code.
Previews change plans as diffs. Each step of a change plan opens as a
diff: your file on the left, the changed version on the right.
Applies a change only when you allow it. Applying is off until you turn
on "Let the extension apply changes" on the Code page of the Tough Round app.
Even then, each change asks first, and the file is left unsaved so you can
undo it.
The status bar shows whether it is connected and which of your Tough Round
projects this window has open.
How it connects
The Tough Round app listens on this computer only (127.0.0.1) and writes its
address and a one-time key to ~/.toughround/editor-bridge.json, which only
your user account can read. The extension reads that file and connects with the
key. Nothing goes over the internet, and the extension only acts on files inside
both a Tough Round project and this window's folders.
Commands
Tough Round: Show connection: whether the app is connected, and what this
window has open.
Tough Round: Reconnect to the app: connect again now.
Tough Round: Apply this change: in a change-plan diff, when applying is
allowed.
Requirements
The Tough Round desktop app, with at least one code project prepared on its
Code page and its folder open in this window.