julia-vscode
julia-vscode copied to clipboard
Debugger does not respect breakpoints Do-Block syntax
What works
json_file = "/path/to/my/file.json"
f = open(json_file, "r")
fc = read(f, String) # breakpoint here
print(fc)
close(f)
Not working:
json_file = "/path/to/my/file.json"
open(json_file, "r") do f
fc = read(f, String) # breakpoint here
print(fc)
end
The debugger will ignore set breakpoint in line fc = read(f, String)
.
This works fine when you clear the functions set as compiled/interpreted with e.g. Julia: Clear compiled modules/functions
. Bit sad that the defaults don't work for this case though.
Thanks again for you quick answer @pfitzseb .
Wow, this indeed works! The workaround deserves its explanation in the docs, I would say. Or is is possible to integrate this somewhere as pre-debug Hook?
Disabling all compiled modules and functions will make the debugger very slow.
A step in the right direction is to make Base.open
as interpreted while keeping the existing stuff as compiled. By doing so, we can step inside open
, like you can see bellow. The remaining problem is that the debugger does not advance into the try catch block. Probably I have to further enable some Base.xyz
stuff as interpreted. Any hints?
Here is my settings.json related config (julia-vscode minimum version 1.6.31)
"julia.debuggerDefaultCompiled": [
"ALL_MODULES_EXCEPT_MAIN",
"-JpegTurbo.",
"-FileIO.",
"-Base.open",
],
I also just encountered this. Glad there was a workaround. Is there any update on improving this functionality, or are we stuck with this same workaround?
Edit: I spoke too soon and this doesn't work for me somehow. For now I am reverting to manually opening and closing the file to use the debugger.