Skip to content
| Marketplace
Sign in
Visual Studio Code>Snippets>Debug LeetCode RefinedNew to Visual Studio Code? Get it now.
Debug LeetCode Refined

Debug LeetCode Refined

Preview

havedifficultyinfindingnames

|
1 install
| (0) | Free
My personal fix for debug-leetcode
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Debug LeetCode

Solve LeetCode problems in VS Code and enjoy debugging

[!NOTE] Forked from vscode-debug-leetcode. Major changes include clangd support for debugging c++.

  • English Document | 中文文档

Attention

This extension should work with vscode-leetcode

Debug a Problem

debug

Currently debug-leetcode only support Python3, Javascript and cpp language and in the future we will support more lanuages which support vscode debug protocal. Welcome to get PR for another language. My next plan is to support c and java.

Not all problems are supported(most free problems are supported) and only supported problems have debug option.

If you have any issue about the debug feature, you can create a issue with detail information

Python3 debug

Requirement

  • Step 1. Install the Python extension for Visual Studio Code.

  • Step 2. Install a supported version of Python3 on your system (note: that the system install of Python on macOS is not supported) and add python command to your environment.

Cpp debug

Requirement

  • Step 1. Install the C/C++ extension for Visual Studio Code. or Step 1. Install the CodeLLDB and clangd for Visual Studio Code.

  • Step 2. Install gcc or clang with gnu sysroot.

Javasript debug

Nothing just vscode

Be careful ❗️

Extention will generate some stub code in your current file like:

For python:

# @before-stub-for-debug-begin
from python3problem1 import *
from typing import *
# @before-stub-for-debug-end

For javascript

// @after-stub-for-debug-begin
module.exports = twoSum;
// @after-stub-for-debug-end

For cpp

// @before-stub-for-debug-begin
#include "commoncppproblem4.h"
// Intentionally include the header again for clangd
#include <bits/stdc++.h>
using namespace std;
// @before-stub-for-debug-end

If you delete some stub code and forget to restore, you can delete all the stub code and the extension will generate again in next debug.


  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft