[ANN] Inline Debugging for Code Cells in VS Code (Call for Testing)

Hi everyone,

This post announces an upcoming feature for the Julia VS Code extension: Inline Cell Debugging.

I’m sharing this Pull Request as an announcement because the core functionality is now complete, and a prebuilt VSIX package is available for immediate testing. This allows the community to try the feature easily and provide feedback before the final merge.

How to Try It

Links:

Instructions:

  1. Install: Download and install the prebuilt VSIX package linked above. If you have persistent sessions enabled (e.g. via tmux), make sure to restart the REPL after installation.
  2. Manual Build (Optional): If you prefer to build from source, clone the PR branch and patch the DebugAdapter.jl package as described in the PR.
  3. Run: Start a Julia REPL, define some variables, and click the Debug CodeLens that appears above your code cells.

Demonstration

  1. Context Setup: Run cell 0 (x = 1). Then multi-select cell 2 and cell 4 (Fig. 1).
  2. Initiate Debugging: Run the Julia: Debug Code Cell command. The debugger inherits the x variable from the active REPL.
    Note: Clicking the Debug CodeLens triggers debugging for a single cell only.
  3. Step 1: The debugger enters the first selected cell and pauses at line 7. The value of x updates to 3 (Fig. 2).
  4. Step 2: Click Continue. The debugger resumes execution, completes cell 2, and breaks at line 13 in cell 4, with x now equal to 15 (Fig. 3).

What Is Inline Debugging?

Many users including me rely on the Execute Code Cell workflow to interactively build models and scripts. Until now, debugging these cells required running the entire file or manually managing execution state. This feature changes that by bringing the full power of the debugger directly into the interactive workflow.

Key Features

1. One-Click Debugging

A Debug button (CodeLens) now appears above every code cell, right next to Run. Clicking it instantly launches a debug session for that specific block of code.

2. Context Inheritance (REPL Awareness)

The debugger now inherits the state of the active REPL session. If a variable x is defined in the REPL, the debugger can access and use it. There is no longer a need to restart the session or load a clean environment just to debug a few lines of code.

3. Multi-Cell Support

Multiple cells can be multi-selected and run using the Julia: Debug Code Cell command, allowing users to step through several code blocks sequentially.

Requirements:

  • Active REPL: At the moment, debugging cells requires an active REPL, but this may be relaxed or improved later.

Feedback on this new workflow is highly appreciated. Does this fit how you use code cells? Please share your thoughts and bug reports in the comments or on the PR!

4 Likes