@run macro

I am trying to debug my code in VS Code.
Presenter in the video JuliaCon 2020 | Using VS Code for Julia development | David Anthoff uses @run macro.
I cannot find it/use it:

julia> @run MyModule.myFunction()
ERROR: LoadError: UndefVarError: @run not defined
in expression starting at REPL[19]:1

Thank you.

You need to run that line in the integrated REPL (the one opened with the Julia: Start REPL command).

1 Like

Thank you. With integrated REPL I can run @run marco. However…

My function executes web service:

function run()
    HTTP.serve(requestHandler, "0.0.0.0", 8080)
end

When I set a breakpoint inside my requestHandler and use @run macro, Pause, Restart etc. buttons are nicely activated on top of VS Code. But when I call from outside on my service, execution doesn’t stop at the breakpoint (at any breakpoint), but it definitely runs, because it prints output to the integrated Julia REPL terminal.