Juno.@run to run an expression and stop at any breakpoints, and
Juno.@enter to step into the function and start stepping on the first line.
There are UI elements for setting breakpoints
in files, by clicking the empty space left of the line numbers, or
when entering a function/method , by using the Break on... text box on the right – either enter a function name (e.g. sin) to set breakpoints for all methods of that function, or specify the argument types (e.g. sin(Int)).
These breakpoints are unconditional by default, but can be switched to conditional breakpints with the button on the right.
Important: If you want to set breakpoints in files you need to have loaded Revise.jl and Revise needs to be aware of the file in question. This means that you can only set breakpoints in your own scripts (that are not part of a package) if you have includet them.
This has been in Juno for a while now, but mostly hidden. Use Juno.@trace to get inline performance annotations for your functions, provided by Traceur.jl.
If you have Weave.jl and language-weave (as well as pdf-view for pdf previews) installed, you can weave a file to pdf or html with a single button press.
Installation
Important : Restart Atom before updating julia-client or ink and do not start a Julia session.
If that does not work, close all Atom instances and type
This is amazing, thank you! The debugging interface is really slick.
I’m having an error setting breakpoints, and think I followed the installation instructions correctly. Updating packages within atom never works for me, so I closed Atom, used the command line to apm uninstall and apm install ink/julia-client, then started Atom, updated packages (Atom/Juno included), restarted Atom.
In this fresh session, I do using Revise; includet("my/file.jl"). When I try to set a breakpoint with alt-x, I get an Error in Debugger popup:
MethodError: no method matching haskey(::String, ::String)
Closest candidates are:
haskey(!Matched::Base.Iterators.Pairs, ::Any) at iterators.jl:247
haskey(!Matched::Dict, ::Any) at dict.jl:546
haskey(!Matched::Base.ImmutableDict, ::Any) at dict.jl:731
...
Interestingly, actually setting a breakpoint and hitting it with Juno.@run seems to work just fine.
Did I mess up the install somehow?
I’d bet you’re running into a problem with mismatched package versions – you need to be on julia-client v0.8.1 and Atom.jl v0.8.2 for things to work. Also make sure you have saved your file before setting breakpoints.
In fact, I do using Revise and use includet. Is there anything wrong with my Juno setting?
Probably not. For some reason Revise doesn’t seem to know about the file you’re trying to set the breakpoint in. No idea why though.
I had the same problem and I think, if I am not mistaken, that Revise does not work on functions that were defined inside a script/global scope. The same worked when I set a breakpoint for a function inside a package.
To use breakpoint in a julia sourcecode, do I need to open revise.jl in Juno together with my source code? It says
Important : If you want to set breakpoints in files you need to have loaded Revise.jl and Revise needs to be aware of the file in question . This means that you can only set breakpoints in your own scripts (that are not part of a package) if you have includet them.
Please note: you need to have loaded Revise.jl
Where can I find the file Revise.jl on my file system?
Don’t get it but my Atom seems to be always (half)broken. I have Uber-Juno installed and .jl files are rcognised as Julia files but there is no “Packages->Julia”, nor Ctrl-j, Ctrl-o open any console.
The easiest way to make sure Revise is running is to put using Revise in your .julia/config/startup.jl file. More information can found in the Revise docs. Revise typically runs in the background—you do should not say using Revise in ordinary packages.
Once you have this setup, you should not generally need @bp; instead, just click in the leftmost column of the source display, as those docs that @pfitzseb linked explain.
Thanks, I’ve added using Revise to my startup.jl
The debug example from docs is working.
If I just create a .jl file with a function, then run it, then using Juno.@enter, debugger buttons, etc. - it works just like in the docs.
But trying to set a breakpoint at the next row still throws that error message.
UPD: Problem solved - I had to I includet that file in the console to get working graphical breakpoints.