| Field | Value |
|---|---|
| Status | Accepted |
| Date | 2026-10-26 |
| Spec | installation-and-workspaces, cli |
| Amended by | ADR 0016: the IntelliJ project JDK is no longer 21; it follows the selected JDK |
Practice happens in the IDE, but a workspace shipped no editor configuration: every action needed the terminal, and a breakpoint in a solution could never stop, because user code runs in a runner subprocess under a hang guard. The owner wants cstudy init to create a workspace that opens in IntelliJ IDEA and VS Code with run configurations for every cstudy action on the current solution file, debugging included, and with SDKs and interpreters set up wherever project files can set them.
Two spikes established what the IDEs allow:
- A debug agent attaches headlessly to the real runner in all four languages (debugpy for Python, the Node inspector with
--inspect-waiton type-stripped.tsfiles, which keeps lines and columns, and JDWP for Java and Kotlin), and a runner paused at a breakpoint never times out. - IntelliJ Shell Script configurations expand no macros, so they cannot pass the file in the editor; JAR Application configurations expand
$FilePath$in their program parameters, and Gradle configurations do not. With no editor focused,$FilePath$is the project directory. - IntelliJ's Remote JVM Debug configuration can listen and restart itself after each session; compound configurations start their parts without ordering. Attaching to Node is IntelliJ IDEA Ultimate only, and Python debugging needs a plugin with its own agent.
- VS Code's Java debugger never binds Kotlin breakpoints (vscode-java-debug#241).
cstudystays the judge. IDE configurations runcstudycommands, on the file in the editor or on the active attempt, and never run user code themselves. Debugging runscstudy test --debug, which starts the real runner with its debug agent on 127.0.0.1 and no hang guard, and the IDE attaches to that runner.- One catalog of actions (
domain/ide_actions.py) is rendered into.vscode/and.idea/by one adapter per IDE, so an action added to the catalog reaches both. Tests parse every rendered command line with the real command line. - VS Code:
processtasks runcstudy <action> ${file};doneasks for its outcome through apickStringinput. Each debug configuration (Python with debugpy, TypeScript with node, Java with java) first runscstudy test --debugas a background task whose problem matcher ends at cstudy'swaiting for debuggerline, then attaches. Kotlin gets tasks only. - IntelliJ: current-file configurations are JAR Application configurations that start a launcher jar, which runs
cstudywith their arguments, standard streams and exit code. The jar is built reproducibly fromtools/ide-launcher/, shipped in the package, and copied into.cs/runtime/ide/by every runtime refresh, socstudy doctor --fixrestores it in a fresh clone. Active-attempt and workspace actions are Shell Script configurations run in the terminal. - IntelliJ debugs Java and Kotlin in listen mode: Debug JVM (listen) waits on port 5005 and restarts after each session, and a compound starts it together with
cstudy test --debug --debug-connect, whose JVM connects to it; cstudy retries the connection for about 10 s because the compound does not order its parts. - SDKs:
.idea/misc.xmlnames the project JDK21, the practice projects' toolchain, and.idea/gradle.xmllinksjvm/run with that JDK;.vscode/settings.jsonpoints atpython/.venvandtypescript/node_modules/typescript. SDK definitions that IDEs keep per user stay manual and are listed in the workspace README. - Generated files are the user's to edit.
.cs/ide.json, tracked with them, records the digest of each file cstudy wrote; regenerating overwrites only files that are missing or still as written, keeps the others with a warning until--force, and never touches files cstudy did not write.
- A fresh workspace opens with every action one click away in both IDEs, and a breakpoint stops in the code cstudy judges, with the same cases, comparators and progress as the terminal.
- The package ships a 3.7 KB binary. It is reproducible with javac 21 (javac 17 emits other bytes for the same
--release 17), and a slow test rebuilds it and compares the bytes; changing the launcher means runningtools/ide-launcher/build.shand committing the jar. - IntelliJ users need a JDK to run the launcher, which the JVM projects need anyway. The open-file configurations fail with "unable to access jarfile" until the runtime exists, that is, until
cstudy doctor --fix,cstudy ideor any run on a fresh clone. - IntelliJ rewrites
misc.xmlandgradle.xmlwhen it imports the project;cstudy idethen keeps them and says so, which is the rule working as intended. - Debugging is one configuration per language in VS Code (Kotlin excluded) and one compound for both JVM languages in IntelliJ (Python and TypeScript excluded); each IDE covers the other's gaps.
- The debug actions depend on the
--debugoptions ofcstudy testand on the name Debug JVM (listen), whichcstudy test --debug --debug-connectquotes when nothing listens.
| Alternative | Why rejected |
|---|---|
| IDE-native test configurations (pytest, JUnit, Node test runner) | They judge with their own harness, not cstudy's cases, comparators, time limits and progress: a second source of truth |
| Debug the solution by launching it directly from the IDE | The code under the debugger would not be what cstudy runs and judges, and no case data reaches it |
| IntelliJ Shell Script or Gradle configurations for the current file | Neither expands $FilePath$ |
| A launcher script instead of a jar | It would need a Shell Script configuration, which expands no macros, or an interpreter configuration per operating system; the jar runs on the JDK the JVM projects already need |
Build the launcher at cstudy init or on first use |
Every machine would need javac before its first IntelliJ run; the committed jar is small and checked against a rebuild |
Commit the launcher into the workspace (.idea/) |
A binary in the user's repository that goes stale on upgrades; the runtime copy refreshes with cstudy |
| IntelliJ attach mode, with the runner's JVM listening | Every run needs a second click once cstudy is waiting; listen mode with auto restart is one click and stays ready between runs |
| Kotlin debugging in VS Code | Breakpoints never bind (vscode-java-debug#241), and the community Kotlin extension is deprecated |
| Python and TypeScript debugging in IntelliJ | Node attach is Ultimate only; Python debugging needs a plugin whose agent is not debugpy |
| Overwrite the IDE files on every run | Destroys the user's edits; the manifest makes regenerating safe |
| An ignored manifest, or markers inside the files | An ignored manifest leaves a clone unable to tell cstudy's files from the user's; JSON allows no markers, and IntelliJ drops XML comments when it saves |