Skip to content

LeetCode Helper is a Visual Studio Code extension designed to streamline solving LeetCode problems. It allows you to fetch problem statements, run test cases, and manage solution files directly within VS Code

Notifications You must be signed in to change notification settings

ashishexe/cph-vscode-extension-leetcode

Repository files navigation

LeetCode Helper Extension

demonstration video explaining all the features of the extension and how to use them - https://www.youtube.com/watch?v=KXRde3BNKEU

Table of Contents

Badges

Build Status License Version leetcode TypeScript C++ C python javascript json cmake

Overview

LeetCode Helper is a Visual Studio Code extension designed to streamline the process of solving LeetCode problems. It provides a seamless interface to write, test, and debug your solutions directly within VS Code.

Features

  • Fetch LeetCode Problems: Quickly fetch problem statements and test cases.
  • Run Test Cases: Execute your code against provided test cases and see the results instantly.
  • Solution File Management: Automatically generate and manage solution files.
  • Error Handling: Detailed error messages to help you debug your code with Expected and Actual results.
  • Panel for running commands:User can use the panel that is present on the left side to run command instead of using command panel(also added key bindings to all commands).
  • Edit Testcases or add more test cases: User can either edit/add/delete testcases by going to the directory where the testcases file are saved by using "Get I/O File Directory".

Installation

  1. Open VS Code.
  2. Go to the Extensions view by clicking the Extensions icon in the Activity Bar on the side of the window.
  3. Search for LeetCode Helper.
  4. Click Install.

Usage

  1. Open the Command Palette (Ctrl+Shift+P) or Directly access from left side panel
  2. Type LeetCode Helper: Fetch Problem to fetch a new problem(add extra test cases too if you want too).
  3. Write your solution in the generated file(in both python and c++).
  4. Run your test cases using LeetCode Helper: Run Test Cases. / or use CTRL+5.

Extension Settings

This extension contributes the following settings:

  • leetcodeHelper.enable: Enable/disable this extension.
  • leetcodeHelper.language: Set the default programming language for solutions.

Known Issues

  • Some edge cases might not be handled correctly.
  • for testing C++ you may need to parse the variables from input files manually depending on the data type inside the run_test_case function (please refer to this page for better understanding - https://stackoverflow.com/questions/9551014/reading-parsing-text-file-input-c)
  • Limited support for languages(only python and cpp)
  • All test are not checked in one go you need to check for each test case individually
  • a clear falied messege might not show if your test case fails

Release Notes

1.0.0

  • Initial release of LeetCode Helper.

Contributing

We welcome contributions to improve this project. Please follow these guidelines:

  1. Fork the repository.
  2. Create a new branch for your feature or bugfix.
  3. Make your changes and commit them with clear and concise messages.
  4. Push your changes to your forked repository.
  5. Create a pull request to the main repository.

Code of Conduct

We expect all contributors to adhere to our Code of Conduct. Please read it before contributing.

Troubleshooting

If you encounter any issues, try the following steps:

  1. Ensure you have the latest version of the extension installed.
  2. Check the extension settings to ensure they are configured correctly.
  3. Restart VS Code.
  4. If the issue persists, please open an issue on the GitHub repository.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Changes Made

  • Error Handling: Improved error handling in extension.ts and executeCode.ts to capture actual output even when test cases fail.
  • Output Normalization: Added normalization for output comparison.
  • Logging: Enhanced logging for better debugging.
  • Solution File Management: Automatically generate and manage solution files.

Thanks for your time

About

LeetCode Helper is a Visual Studio Code extension designed to streamline solving LeetCode problems. It allows you to fetch problem statements, run test cases, and manage solution files directly within VS Code

Topics

Resources

Stars

Watchers

Forks