Problem with @enter when using Debugger.jl in VS Code console

Hi, everyone,

I am using Debugger.jl in VS Code REPL. It seems that there is a problem of the @enter macro, as following code shows:


julia> using Debugger

julia> foo(x) = x^2
foo (generic function with 1 method)

julia> @enter foo(2)
ERROR: UndefVarError: @enter not defined
Stacktrace:
 [1] top-level scope
 [2] include_string(::Function, ::Module, ::String, ::String) 
at .\loading.jl:1088

julia> 

I am using Julia 1.5.1 and Debugger version 0.6.6

How could I avoid this error message and use Debugger in VS Code REPL?

Just omit the using Debugger and you’ll use VSCode’s visual debugger.

If you prefer the text-based debugger then do:

import Debugger
Debugger.@enter foo(2)

This avoids the collision with VSCodeServer.@enter (which is exported too).

3 Likes

Thank you Tim, perfect explanation! Help me a lot since I’ve struggled with Debugger for long time.