Solve LeetCode problems in VS Code with enhanced split view and problem list management
This is an enhanced version of the original vscode-leetcode extension with the following improvements:
- Description on Left, Code on Right: When viewing a problem, the description automatically opens in the left column and the code editor in the right column
- Consistent Layout: All related views (submit results, test results, description) open in the left column for better organization
- Configurable: Can be enabled/disabled via
leetcode.enableSplitView
setting
- Custom Problem Lists: Create and manage your own problem lists
- Official Lists Support: Support for both official LeetCode problem lists and custom lists
- URL-Based Problem Lists: Create problem lists from any LeetCode study plan or problem list URL
- Easy Management: Right-click on problems to add/remove from lists
- Persistent Storage: Problem lists are saved locally and persist across VS Code sessions
- Better Layout: All webview panels (submit, test, description) now respect the split view setting
- Consistent Behavior: Unified display behavior across all LeetCode-related views
- Smart Positioning: Views automatically position themselves based on your split view preference
LeetCode: Create Problem List
- Create a new custom problem list (empty or from URL)LeetCode: Manage Problem Lists
- View and manage existing problem listsLeetCode: Add to Problem List
- Add current problem to a listLeetCode: Remove from Problem List
- Remove current problem from a list
leetcode.enableSplitView
- Enable/disable split view mode (default: true)
Feature | Original | Enhanced |
---|---|---|
Split View | β No | β Yes - Description left, code right |
Problem Lists | β No | β Yes - Custom and official lists |
View Consistency | β Mixed | β Yes - All views respect split setting |
List Management | β No | β Yes - Full CRUD operations |
Layout Control | β Limited | β Yes - Configurable split behavior |
- Search for "LeetCode Enhanced" in the VS Code Extensions marketplace
- Click Install
- Published by: keyang
- Download the latest .vsix file from GitHub Releases
- Install via VS Code:
code --install-extension vscode-leetcode-enhanced-[version].vsix
git clone https://github.com/KindofCrazy/vscode-leetcode.git
cd vscode-leetcode
npm install
npm run compile
vsce package
code --install-extension *.vsix
- Sign in to LeetCode using the LeetCode Explorer panel
- Browse problems - click any problem to open it with split view
- Create problem lists - right-click on problems to add them to lists
- Manage your lists - use the Problem List section in the explorer
{
"leetcode.enableSplitView": true // Enable split view mode
}
- Create List: Use
LeetCode: Create Problem List
command - Add Problems: Right-click on any problem β "Add to Problem List"
- Manage Lists: Use
LeetCode: Manage Problem Lists
command - Create from URL: Use
LeetCode: Create Problem List
command (select "Import from URL" option)
- π Study Plans - Any LeetCode study plan URL (e.g.,
/studyplan/top-100-liked/
) - π Problem Lists - Any LeetCode problem list URL (e.g.,
/problem-list/5VgExJRB/
) - π Both Domains - Support for both leetcode.cn and leetcode.com
- π― Auto-Naming - Intelligent naming based on URL patterns
- VS Code 1.57.0+
- Node.js 10+
NOTE: Please make sure that
Node
is in yourPATH
environment variable. You can also use the settingleetcode.nodePath
to specify the location of yourNode.js
executable.
Recommended: Use Cookie login for the best experience with this enhanced extension.
- Web Authorization may redirect to the original LeetCode extension
- Cookie Login provides direct access to this enhanced version
- More Reliable for the enhanced features (split view, problem lists)
-
Get your LeetCode Cookie (via Network β GraphQL):
- Open the LeetCode website (
leetcode.com
orleetcode.cn
) and make sure you are logged in - Press F12 to open Developer Tools
- Go to the Network tab, filter to Fetch/XHR, then refresh the page (F5)
- Click any
graphql
request in the list - In the right panel, under Request Headers, find the
Cookie
header and copy its full value
- Open the LeetCode website (
-
Login with Cookie:
- Click
Sign In
in the LeetCode Explorer - Select
LeetCode Cookie
(marked as Recommended) - Paste the Cookie header value you copied in step 1
- You're logged in!
- Click
Note: For
leetcode.cn
, follow the same steps on the Chinese site and use the copiedCookie
header value. This method follows guidance similar to community tutorials CSDN blog reference.
-
Simply click
Sign in to LeetCode
in theLeetCode Explorer
will let you sign in with your LeetCode account. -
You can also use the following command to sign in/out:
- LeetCode: Sign in
- LeetCode: Sign out
-
By clicking the button
at the explorer's navigation bar, you can switch between different endpoints.
-
The supported endpoints are:
- leetcode.com
- leetcode.cn
Note: The accounts of different endpoints are not shared. Please make sure you are using the right endpoint. The extension will use
leetcode.com
by default.
-
Directly click on the problem or right click the problem in the
LeetCode Explorer
and selectPreview Problem
to see the problem description. -
Select
Show Problem
to directly open the file with the problem description.NoteοΌYou can specify the path of the workspace folder to store the problem files by updating the setting
leetcode.workspaceFolder
. The default value isοΌ$HOME/.leetcode/.You can specify whether including the problem description in comments or not by updating the setting
leetcode.showCommentDescription
.You can switch the default language by triggering the command:
LeetCode: Switch Default Language
.
-
The extension supports 5 editor shortcuts (aka Code Lens):
Submit
: Submit your answer to LeetCode.Test
: Test your answer with customized test cases.Star/Unstar
: Star or unstar the current problem.Solution
: Show the top voted solution for the current problem.Description
: Show the problem description page.
Note: You can customize the shortcuts using the setting:
leetcode.editor.shortcuts
. By default, onlySubmit
andTest
shortcuts are enabled.
- To manage your LeetCode sessions, just clicking the
LeetCode: ***
at the bottom of the status bar. You can switch between sessions or create, delete a session.
Setting Name | Description | Default Value |
---|---|---|
π Enhanced Settings | ||
leetcode.enableSplitView |
NEW: Enable split view mode - description on left, code editor on right | true |
Original Settings | ||
leetcode.hideSolved |
Specify to hide the solved problems or not | false |
leetcode.defaultLanguage |
Specify the default language used to solve the problem. Supported languages are: bash , c , cpp , csharp , golang , java , javascript , kotlin , mysql , php , python ,python3 ,ruby ,rust , scala , swift , typescript |
N/A |
leetcode.useWsl |
Specify whether to use WSL or not | false |
leetcode.endpoint |
Specify the active endpoint. Supported endpoints are: leetcode , leetcode-cn |
leetcode |
leetcode.workspaceFolder |
Specify the path of the workspace folder to store the problem files. | "" |
leetcode.filePath |
Specify the relative path under the workspace and the file name to save the problem files. More details can be found here. | |
leetcode.enableStatusBar |
Specify whether the LeetCode status bar will be shown or not. | true |
leetcode.editor.shortcuts |
Specify the customized shortcuts in editors. Supported values are: submit , test , star , solution and description . |
["submit, test"] |
leetcode.enableSideMode |
Specify whether preview , solution and submission tab should be grouped into the second editor column when solving a problem. |
true |
leetcode.nodePath |
Specify the Node.js executable path. for example, C:\Program Files\nodejs\node.exe |
node |
leetcode.showCommentDescription |
Specify whether to include the problem description in the comments | false |
leetcode.useEndpointTranslation |
Use endpoint's translation (if available) | true |
leetcode.colorizeProblems |
Add difficulty badge and colorize problems files in explorer tree | true |
leetcode.problems.sortStrategy |
Specify sorting strategy for problems list | None |
leetcode.allowReportData |
Allow LeetCode to report anonymous usage data to improve the product. list | true |
src/
βββ commands/
β βββ problemList.ts # New: Problem list management commands
β βββ show.ts # Enhanced: Split view support
βββ problemList/
β βββ problemListManager.ts # New: Problem list data management
βββ webview/
β βββ leetCodePreviewProvider.ts # Enhanced: Split view support
β βββ leetCodeSubmissionProvider.ts # Enhanced: Split view support
βββ shared.ts # Enhanced: New interfaces and types
- Backup your settings (optional)
- Uninstall the original extension
- Install this enhanced version
- Your existing problems and settings will be preserved
This project is based on the original vscode-leetcode extension.
- All original LeetCode functionality
- Sign in/out capabilities
- Problem browsing and solving
- Test and submit functionality
- All original settings and configurations
- Split view layout system
- Problem list management
- Enhanced user interface
- Improved view consistency
When you meet any problem, you can check out the Troubleshooting and FAQ first.
If your problem still cannot be addressed, feel free to reach us in the Gitter Channel or file an issue.
Refer to CHANGELOG
This project is licensed under the MIT License - see the LICENSE file for details.
- Original Project: Based on vscode-leetcode by @LeetCode-OpenSource
- Core CLI: Built on leetcode-cli by @skygragon
- Contributors: Thanks to all contributors of the original project
- Issues: GitHub Issues
- Documentation: Wiki
- Original Project: vscode-leetcode
Note: This is an enhanced fork of the original vscode-leetcode extension. All original functionality is preserved while adding new features for better user experience.