LeetCode for VS Code
Read LeetCode problems inside your editor — no browser tab switching required.
Search any problem by number or title, open today's daily challenge, and get a clean rendered preview with starter code scaffolded in your language of choice, all without leaving VS Code.
Features
Search Problems
Open any LeetCode problem by number or title via the Command Palette. The full problem list is fetched and filtered inline — just start typing.
Daily Challenge
One command opens today's LeetCode daily challenge directly in a preview panel.
In-Editor Problem Preview
Problem statements render in a dedicated VS Code WebviewPanel with syntax-highlighted code blocks and clean typography. The view reuses VS Code's own color tokens so it looks right in any theme.
Solution File Scaffolding
When a problem loads, the extension optionally creates a starter file with LeetCode's official code snippet for your configured language. Supports Go, Python, C++, Java, TypeScript, and every other language LeetCode provides.
A dedicated sidebar panel shows the currently loaded problem and provides quick access to the preview.
Commands
All commands are available via the Command Palette (Cmd+Shift+P / Ctrl+Shift+P) under the LC category.
| Command |
Description |
LC: Search |
Search and open any LeetCode problem |
LC: Open Daily Problem |
Load today's daily challenge |
LC: Focus on Problem Preview |
Re-open the preview for the loaded problem |
LC: Create or Open Solution File |
Create/reveal the starter solution file |
Configuration
| Setting |
Default |
Description |
leetcodeHelper.solutionLanguage |
golang |
LeetCode langSlug for starter files (e.g. python3, cpp, java) |
leetcodeHelper.initSolutionFileOnOpen |
true |
Auto-create a solution file when a problem loads |
leetcodeHelper.solutionRelativePath |
"" |
Subfolder under the workspace root for solution files |
leetcodeHelper.solutionFileName |
"" |
Custom output filename. Use {slug} as a placeholder for the problem slug |
Example: Go solutions in a solutions/ folder
{
"leetcodeHelper.solutionLanguage": "golang",
"leetcodeHelper.solutionRelativePath": "solutions",
"leetcodeHelper.solutionFileName": "{slug}/main.go"
}
This would create solutions/two-sum/main.go with LeetCode's Go starter code.
Requirements
- VS Code 1.85 or later
- Internet access to reach
leetcode.com (problem data is fetched via LeetCode's public API)
- No LeetCode account required for free problems
Security
Problem HTML from LeetCode is sanitized before rendering — scripts, inline event handlers, and javascript: / vbscript: URLs are stripped. The preview webview runs with enableScripts: false and a strict default-src 'none' Content Security Policy.
Known Limitations
- Premium problems — problems marked as premium-only on LeetCode will not return content without a paid account.
- Submission / run code — this extension is read-only. It fetches problem statements and scaffolds starter files; it does not submit solutions or run code against LeetCode's judge.
- Offline mode — not supported in v1. An internet connection is required.
License
MIT