You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The debugging vignette says RStudio debugging doesn't work with R6 methods. A step towards this would be to allow breakpoints to be set in methods by location, similar to the utils::setBreakpoint function.
The function would also work on an instance, but I haven't added it: I'm not sure all users would want a new setBreakpoint method to show up. Alternatively, the standard function can be used on instance as
setBreakpoint("filename#line", envir = instance)
though I don't think this will see private methods.
In order to allow breakpoints to be set in RStudio, it would also need to identify ranges of code that are within the
R6Class definition. This could be tricky, because function definitions might not appear within the call, e.g.
The debugging vignette says RStudio debugging doesn't work with R6 methods. A step towards this would be to allow breakpoints to be set in methods by location, similar to the
utils::setBreakpoint
function.I've written a simple version of this, which appears as a generator method: https://github.com/dmurdoch/R6/blob/b233e0a2f3f6d922df753416729992000d1f5f73/R/generator_funs.R#L105 .
The function would also work on an instance, but I haven't added it: I'm not sure all users would want a new
setBreakpoint
method to show up. Alternatively, the standard function can be used oninstance
asthough I don't think this will see private methods.
In order to allow breakpoints to be set in RStudio, it would also need to identify ranges of code that are within the
R6Class definition. This could be tricky, because function definitions might not appear within the call, e.g.
However, I guess there would be some workaround.
I'd be happy to put together a PR for this if there's interest.
The text was updated successfully, but these errors were encountered: