VSCode LeetCode Extension
Overview
VSCode LeetCode is a powerful Visual Studio Code extension that seamlessly integrates LeetCode into your coding environment. With this extension, you can effortlessly log in to LeetCode, browse problems, write solutions, and submit your answers—all without leaving VS Code.
Features
- Direct Login to LeetCode: Authenticate your LeetCode account within VS Code.
- Browse LeetCode Problems: Access the full list of LeetCode problems and view problem details.
- Write and Edit Solutions: Utilize VS Code's robust editing features to write your code.
- Submit Solutions: Submit your answers to LeetCode directly from the editor and view submission results.
- Problem Navigation: Easily navigate between problems and your solution files.
- Supported Languages: Multiple programming languages supported for solutions (e.g., Python, JavaScript, Java, C++, etc.).
Installation
Prerequisites
Visual Studio Code: Ensure you have the latest version installed. Download VS Code
Node.js: Install Node.js from the official website.
Yeoman and VS Code Extension Generator:
npm install -g yo generator-code
Installing the Extension
From the VS Code Marketplace
- Open VS Code.
- Go to the Extensions view by clicking on the Extensions icon in the Activity Bar or pressing
Ctrl+Shift+X
(Cmd+Shift+X
on macOS).
- Search for "VSCode LeetCode".
- Click Install.
From Source
Clone the Repository:
git clone https://github.com/your-username/vscode-leetcode.git
cd vscode-leetcode
Install Dependencies:
npm install
Compile the Extension:
npm run compile
Package the Extension:
Ensure you have vsce
installed:
npm install -g vsce
vsce package
Install the Extension:
code --install-extension vscode-leetcode-0.0.1.vsix
Usage
1. Login to LeetCode
Command Palette:
- Press
Ctrl+Shift+P
(Cmd+Shift+P
on macOS) to open the Command Palette.
- Type
LeetCode: Login
and select it.
Input Credentials:
- Enter your LeetCode Username.
- Enter your LeetCode Password.
Confirmation:
- A success message will appear upon successful login.
2. Browse and Select Problems
Command Palette:
- Open the Command Palette.
- Type
LeetCode: Show Problems
and select it.
Problem List:
- A sidebar will display a list of available LeetCode problems.
- Click on any problem to open its details.
3. Write and Edit Solutions
Open Editor:
- Click on a problem to open a new editor window with the problem details.
Write Code:
- Utilize VS Code's powerful editing features to write your solution in your preferred programming language.
4. Submit Solutions
Command Palette:
- With your solution open, press
Ctrl+Shift+P
(Cmd+Shift+P
on macOS) to open the Command Palette.
- Type
LeetCode: Submit Solution
and select it.
Submission:
- The extension will submit your code to LeetCode.
- View the submission status and results directly within VS Code.
Commands
Command |
Description |
LeetCode: Login |
Authenticate your LeetCode account |
LeetCode: Logout |
Sign out of your LeetCode account |
LeetCode: Show Problems |
Display a list of available LeetCode problems |
LeetCode: Submit Solution |
Submit your current solution to LeetCode |
LeetCode: Show Submissions |
View your submission history |
Tip: You can view all available commands by opening the Command Palette (Ctrl+Shift+P
or Cmd+Shift+P
on macOS) and typing LeetCode
.
Configuration
You can customize the extension settings to fit your workflow.
Settings
Accessing Settings
- Open VS Code settings:
- Go to
File
> Preferences
> Settings
(Code
> Preferences
> Settings
on macOS).
- Search for
LeetCode
to view and modify available settings.
Contributing
Contributions are welcome! If you'd like to contribute to the development of the VSCode LeetCode extension, please follow these guidelines:
Steps to Contribute
Fork the Repository:
Click the Fork button on the GitHub repository to create a personal copy.
Clone Your Fork:
git clone https://github.com/your-username/vscode-leetcode.git
cd vscode-leetcode
Install Dependencies:
npm install
Create a New Branch:
git checkout -b feature/YourFeatureName
Make Your Changes:
Implement your enhancements or bug fixes.
Commit Your Changes:
git commit -m "Add feature: YourFeatureName"
Push to Your Fork:
git push origin feature/YourFeatureName
Create a Pull Request:
Navigate to the original repository and create a pull request detailing your changes.
Code of Conduct
Please adhere to the Contributor Covenant Code of Conduct to ensure a welcoming environment for all contributors.
License
This project is licensed under the MIT License.
Feedback and Support
If you encounter any issues or have suggestions for improvements, feel free to open an issue on GitHub.
Connect with other users and stay updated with the latest releases:
Happy Coding! 🚀