VSForces
VSForces bridges Codeforces with VS Code — giving you a full competitive programming workflow without leaving your editor.
- 🔍 Browse and fetch random problems by rating, contest year, and tags
- 📄 Read the full problem statement (with LaTeX math) in the VS Code sidebar
- ⚡ Test cases auto-load into CPH Judge in your currently open file — no new file created, no language prompt
- 🚀 Submit your solution to Codeforces directly from VS Code
- 🏆 Track submission verdicts in real time
- ⏱️ Built-in per-problem stopwatch
- 🔥 Daily solve streak tracker
How It Works
VSForces is made of two parts that work together:
Codeforces Page
│ (content script scrapes problem)
▼
Chrome Extension ──────────────────────┐
│ WebSocket ws://127.0.0.1:6543 │
▼ │
VS Code Extension ◄─────────────────────┘
├── Sidebar (problem statement + timer)
└── Writes .prob file → CPH Judge auto-detects
You need both installed for VSForces to work.
Requirements
Node.js is NOT required — you are installing a pre-built extension, not building from source.
Installation
Step 1 — Install the VS Code Extension
- Open VS Code
- Go to the Extensions view (
Ctrl+Shift+X)
- Search for VSForces
- Click Install
Alternative: install from a .vsix file
- Download the latest
vsforces-<version>.vsix
- Open VS Code → Extensions view (
Ctrl+Shift+X)
- Click the
··· menu → Install from VSIX…
- Choose the downloaded file
Step 2 — Install CPH Judge
- Open VS Code → Extensions view (
Ctrl+Shift+X)
- Search for Competitive Programming Helper
- Install the extension by DivyanshuAgrawal
Step 3 — Install the Chrome Extension
- Open the VSForces Bridge page on the Chrome Web Store
- Click Add to Chrome
- Confirm the permissions prompt
💡 Using Edge? The Chrome Web Store works in Edge too — or search for VSForces Bridge in the Edge Add-ons store.
💡 Pin the extension to your toolbar for easy access.
Step 4 — Set CPH Default Language (Recommended)
To prevent CPH from prompting for a language every time:
- Open VS Code Settings (
Ctrl+,)
- Search for
cph.general.defaultLanguage
- Set it to your preferred language:
cpp, java, python, etc.
Usage
Before You Start
Open your solution file in VS Code (Main.java, solution.cpp, etc.) before browsing to a problem. CPH loads test cases into whichever file is currently active.
Fetch a Random Problem
- Click the VSForces icon in the VS Code Activity Bar (left sidebar)
- Set Min / Max rating and optionally adjust the contest year slider and tag filters
- Click Get random problem
- The problem opens in Chrome and the statement appears in the sidebar with test cases loaded in CPH automatically
Browse to Any Problem Manually
Navigate to any Codeforces problem page in Chrome — the sidebar and CPH update automatically.
Submit & Track Verdict
Click the Submit button in the sidebar to submit your currently open file directly to Codeforces. The verdict appears in the sidebar once judging completes.
Timer
A stopwatch starts automatically when a new problem loads. You can pause, resume, or reset it manually. It stops automatically on Accepted.
Problem Navigation
VSForces keeps your last 4 problems in a navigation queue. Use the ← → buttons above the problem title to jump back to a previous problem (test cases re-sync with CPH automatically).
Features
| Feature |
Details |
| Problem statement |
Full LaTeX rendering via KaTeX, images included |
| Sample test cases |
Shown inline in the sidebar |
| Submit from VS Code |
Auto-detects language from file extension (C, C++, Java, Python, Kotlin, Go, Rust, JS) |
| CPH integration |
Writes .prob file directly — no file creation, no language prompt |
| CPH auto-refresh |
CPH panel updates immediately without switching tabs |
| Random problem |
Filters by rating range, contest year, and tags |
| Problem navigation |
Back/forward through your last 4 problems |
| Verdict tracking |
Real-time verdict display with submission history |
| Streak tracker |
Tracks your daily solve streak |
| State persistence |
Ratings, current problem, verdict, and timer survive sidebar panel switches |
| Zoom |
Ctrl+Scroll or pinch to zoom the sidebar; Ctrl+0 to reset |
| Editorial link |
Quick link to the editorial when available |
Troubleshooting
| Problem |
Fix |
| Sidebar shows "Extension not connected" |
Make sure both the VS Code extension and the Chrome extension are installed and active |
| Test cases not loading in CPH |
Open your solution file in VS Code before navigating to the problem |
| CPH shows old test cases |
A brief split-pane flicker triggers the CPH reload — this is expected behavior |
<br> appears in test case input |
Reload the Chrome extension: go to chrome://extensions and click the refresh icon on VSForces Bridge |
| Problem statement not appearing |
Navigate to a Codeforces problem page — the statement loads on page visit |
| Chrome extension not connecting |
Ensure VS Code is open with the VSForces extension active, then reload the Chrome extension |
License
Proprietary — All rights reserved. See the LICENSE file for details.