Code Editor
Editor features and shortcuts
CodePlanet's built-in code editor provides a powerful, browser-based coding environment for solving problems and experimenting with code.
Editor Overview
The code editor is powered by Monaco Editor (the same engine behind VS Code), giving you a familiar, production-grade editing experience directly in the browser.
Core Features
| Feature | Description |
|---|---|
| Syntax highlighting | Language-aware coloring for 13+ languages |
| Auto-completion | IntelliSense-style suggestions as you type |
| Error highlighting | Real-time syntax error detection |
| Multi-language | JavaScript, Python, Java, C++, TypeScript, Go, Rust, and more |
| Themes | Light and dark modes |
| Auto-indent | Smart indentation based on language rules |
Supported Languages
The code editor and execution engine support the following languages:
| Language | Version | File Extension |
|---|---|---|
| JavaScript | Node.js | .js |
| Python | Python 3 | .py |
| Java | JDK 17+ | .java |
| C++ | C++17 | .cpp |
| C | C11 | .c |
| TypeScript | Latest | .ts |
| Go | Latest | .go |
| Rust | Latest | .rs |
| PHP | 8.x | .php |
| Ruby | 3.x | .rb |
| Swift | 5.x | .swift |
| Kotlin | Latest | .kt |
| C# | .NET 6+ | .cs |
Keyboard Shortcuts
Editing
| Shortcut | Action |
|---|---|
Ctrl + / | Toggle line comment |
Ctrl + D | Select next occurrence |
Ctrl + Shift + K | Delete line |
Alt + ↑ / ↓ | Move line up/down |
Ctrl + Shift + Enter | Insert line above |
Ctrl + Enter | Insert line below |
Ctrl + Z | Undo |
Ctrl + Shift + Z | Redo |
Execution
| Shortcut | Action |
|---|---|
Ctrl + Enter | Run code |
Ctrl + Shift + Enter | Submit solution |
Navigation
| Shortcut | Action |
|---|---|
Ctrl + G | Go to line |
Ctrl + P | Quick file open (IDE mode) |
Ctrl + F | Find |
Ctrl + H | Find and replace |
Running Code
Quick Execution
- Write your code in the editor
- Select the correct language from the dropdown
- (Optional) Add input in the stdin panel
- Click Run or press
Ctrl + Enter - View output in the Output panel below
Problem Submissions
When solving a problem:
- Read the problem statement and constraints
- Write your solution in the editor
- Click Run to test against sample test cases
- Click Submit to test against all hidden test cases
- View detailed results: pass/fail per test case, runtime, and memory usage
Execution Limits
| Tier | Daily Runs | Monthly Runs | Max Runtime |
|---|---|---|---|
| Free | 15 | 200 | 10 seconds |
| Pro | 100 | 3,000 | 15 seconds |
| Developer | 500 | 15,000 | 30 seconds |
Input/Output
Standard Input
For problems that require reading from stdin, provide your input in the Input panel. Each line of input corresponds to one read operation.
Example (Python):
Standard Output
Your program's output appears in the Output panel. Output is compared against expected results during submissions — whitespace is normalized (leading/trailing whitespace and trailing newlines are trimmed).
Error Handling
The editor provides clear feedback for common issues:
- Compilation Errors — Shown inline with line numbers and error messages
- Runtime Errors — Stack traces displayed in the output panel
- Time Limit Exceeded (TLE) — Your code exceeded the maximum allowed runtime
- Memory Limit Exceeded (MLE) — Your code used too much memory
Tips
- Test locally first: Use the Run button with sample inputs before submitting
- Check edge cases: Empty arrays, single elements, maximum constraints
- Read the constraints: They hint at the expected time complexity
- Use the language you know best: Don't switch languages mid-problem unless necessary