简体中文 | English
Quickly compile, run and judge competitive programming problems in VSCode. Automatically download testcases, or write & test your own problems.
This is the next generation of the Competitive Programming Helper.
- Automatic compilation with display for compilation errors.
- Intelligent judge with support for signals, timeouts and runtime errors.
- Works with Competitive Companion.
- Works locally for your own problems.
- Support for several languages.
| Feature | CPH | CPH-NG |
|---|---|---|
| Automatic Compilation | ✅ | ✅ |
| Intelligent Judge | ✅ | ✅ |
| Competitive Companion | ✅ | ✅ |
| Local Problem Support | ✅ | ✅ |
| Language Support | ✅ C/C++ and 8 others | |
| Auto-submit Integration | ✅ Codeforces and Kattis | |
| Load Local Testcases | ❌ | ✅ |
| Supported Result | ✅ AC and 10 others 1 | |
| Store Result and Time | ❌ | ✅ |
| Cache compiled program | ❌ | ✅ 2 |
| SPJ and interactive | ❌ | ✅ |
| Brute Force Compare | ❌ | ✅ |
- Node.js (v22 or higher)
- pnpm
- Visual Studio Code
-
Clone the repository
git clone https://github.com/langningchen/cph-ng.git cd cph-ng -
Install dependencies
pnpm install
-
Set up Git hooks (for translation checking)
pnpm run install-hooks
-
Start development
pnpm run watch
-
Open in VSCode
- Open the project folder in VSCode
- Press
F5to start debugging - A new Extension Development Host window will open with CPH-NG loaded
pnpm run watch- Start development build with file watchingpnpm run compile- Build for productionpnpm run lint- Run ESLintpnpm run check-translations- Check translation completenesspnpm run install-hooks- Install Git pre-commit hookspnpm run package- Package the extension as.vsix
This project supports internationalization (i18n) with automatic translation checking:
-
Extension Configuration (package.json)
- Add
%key%references in package.json - Add translations in
package.nls.json(English) - Add translations in
package.nls.zh.json(Chinese)
- Add
-
Runtime Messages (Extension code)
- Use
l10n.t('key')in TypeScript code - Add translations in
l10n/bundle.l10n.zh-cn.json
- Use
-
Webview UI (React components)
- Use
t('key')in React components - Add translations in
src/webview/l10n/en.json(English) - Add translations in
src/webview/l10n/zh.json(Chinese)
- Use
- Automatic: Pre-commit hook checks translation completeness
- Manual: Run
pnpm run check-translations - Bypass: Use
git commit --no-verify(not recommended)
-
Development Build
pnpm run compile
-
Create VSIX Package
pnpm run package
-
Install Locally
code --install-extension cph-ng-*.vsix
- Fork the repository
- Create a feature branch:
git checkout -b feature/your-feature - Make changes and ensure translations are complete
- Commit your changes (pre-commit hook will check translations)
- Push to your branch:
git push origin feature/your-feature - Create a Pull Request
- Extension Host: Press
F5in VSCode to start debugging - Webview: Open Chrome DevTools in the webview panel
- Logs: Check VSCode Output panel (CPH-NG channels)
- Compilation: Check Output panel (CPH-NG Compilation channel)
This project is licensed under the terms of the GNU Affero General Public License v3.0.
See GitHub Issues.
See CHANGELOG.md
