VSCode Debugger bugs (are these known issues?)

I’ve been trying out the Julia debugger in VSCode and found a few issues with it.
Windows 11, VSCode 1.93.1, julia-vscode v1.123.2

Are these all known issues? If not, where should I report them, the VScode plugin project, or Debugger?

REPL Mode
within REPL, @run only works once per session; otherwise it hangs and never hits the breakpoint.

Run & Debug Mode
Can’t change breakpoints while paused. Also, this breaks the ‘Run to Cursor’ feature.

Julia: Compiled Code mode worked initially, but stopped working as soon as I changed it. ‘Apply default’ appears to work, but did not restore functionality.

Debugger stopped working at one point and I needed to restart VSCode. Not sure how to repro this one, but I’ll try to identify repro steps.

What version of Julia? What is in your global Project.toml file? Do you have a piece code that can replicate this behavior in a fresh directory?

You can open issues on the Julia VSCode extension GitHub, but I think you’re more likely to get help here.

1 Like

Julia 1.10.5

This is in a new project, only added Revise, Infiltrator

Another person encountered the only can @run once per session bug:

I’ll try to give it a go tomorrow and see if I can figure anything out!

For me this happens in every project. I’ve got about 5 I regularly mess with all with very different dependencies. Here’s my startup.jl file, if that is helpful:

using Pkg

let
    pkgs = ["BenchmarkTools", "OhMyREPL", "Revise", "Crayons"]
    for pkg in pkgs
        if Base.find_package(pkg) === nothing
            Pkg.add(pkg)
        end
    end
end

using BenchmarkTools
using OhMyREPL
using Crayons
import OhMyREPL: Passes.SyntaxHighlighter

try
    using Revise
catch e
    @warn "Error initializing Revise" exception = (e, catch_backtrace())
end



function vscode_color_scheme()
    scheme = SyntaxHighlighter.ColorScheme()

    # colors to match VSCode dark color scheme
    SyntaxHighlighter.string!(scheme, crayon"ce9178")
    SyntaxHighlighter.comment!(scheme, crayon"6A9955")
    SyntaxHighlighter.function_def!(scheme, crayon"DCDCAA")
    SyntaxHighlighter.call!(scheme, crayon"DCDCAA")
    SyntaxHighlighter.macro!(scheme, crayon"DCDCAA")
    SyntaxHighlighter.error!(scheme, crayon"F44747")
    SyntaxHighlighter.number!(scheme, crayon"B5CEA8")
    SyntaxHighlighter.op!(scheme, crayon"d4d4d4")
    SyntaxHighlighter.keyword!(scheme, crayon"569cd6")
    SyntaxHighlighter.symbol!(scheme, crayon"4EC9B0")
    SyntaxHighlighter.argdef!(scheme, crayon"4EC9B0")

    return scheme
end

SyntaxHighlighter.add!("VSCode", vscode_color_scheme())
colorscheme!("VSCode")

ENV["JULIA_EDITOR"] = "code.cmd"

I also created a new empty project with just one file and no dependencies. Here’s the contents of the file:

module Garb

greet() = print("Hello World!")
export greet

end # module Garb

and here are the dependencies:

(Garb) pkg> st
Project Garb v0.1.0
Status `C:\Users\seatt\OneDrive\Documents\temp\Garb\Project.toml` (empty project)

Here’s the result of doing @run greet() twice:

julia> using Garb

julia> @run greet()
Hello World!
julia> @run greet() #debugger goes into infinite wait loop here

Report having the same issue

I have the same issue.

Yes, unfortunately a recurrent issue. But it’s probably not a direct fault of the Julia extension. At least things did not change when I went back to versions that I know were working before.

Could this issue be caused by recent updates to Visual Studio Code? It’s not isolated to Windows, so it might be a more general problem: Debugger runs fine once. When I use it again, it seems to be stuck in a loop · Issue #3688 · julia-vscode/julia-vscode · GitHub