Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>CPH Web JudgeNew to Visual Studio Code? Get it now.
CPH Web Judge

CPH Web Judge

wnbase

| (0) | Free
The CPH test-case interface for VS Code for the Web.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

CPH Web Judge

CPH-style test cases in the VS Code sidebar. Open a C or C++ file, add or import cases, then run one case or all cases. The judge compiles the current editor contents once per batch in Chrome, keeps code and test data on the device, and compares output by whitespace-separated tokens. The timing badge measures elapsed program execution time and excludes compilation.

Install on vscode.dev

When the extension is published to the Visual Studio Marketplace, open its listing in vscode.dev and click Install. C and C++ require only the browser. The compiler assets are loaded on the first run. The bundled Clang toolchain targets WebAssembly and supports self-contained C17 and C++20 solutions, with C++ exceptions disabled, including common standard headers via its compatibility version of <bits/stdc++.h>.

For an unpublished build, host package.json, extension.js, media/icon.svg, and the compiler/ directory at a single HTTPS URL with CORS enabled. In vscode.dev, run Developer: Install Extension From Location… and enter that URL. The school device only needs to reach the host.

Build and test

Run npm ci and npm run build. This produces the extension entry point and copies the compiler assets into compiler/. To test the extension in a local browser-hosted VS Code, run npx @vscode/test-web --extensionDevelopmentPath=..

The optional local runner remains available for Python and JavaScript. Run node runner.mjs on a computer with Node installed, then use the sidebar gear to enter the runner URL and token. The runner uses the local Python interpreter or Node, and on macOS and Linux uses Python 3 to measure CPU time.

Test case import

The folder icon accepts JSON arrays or Competitive Companion-shaped JSON containing name and tests. The extension imports the JSON file manually.

{
  "name": "Problem 1: Sleeping in Class",
  "tests": [{ "input": "1\n", "output": "1\n" }]
}

Credits

Original CPH stylesheet and activity icon by Divyanshu Agrawal and CPH contributors, from agrawal-d/cph, GPL-3.0-or-later. This port adds a browser extension host, a webview adapter, and a local runner. See LICENSE. Codicons are distributed under their bundled license.

The browser compiler is browsercc 0.1.1, with LLVM/Clang and WASI SDK, and the browser WASI shim. License notices are bundled in the package.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft