-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Breakpoints not triggered in VS Code R Debugger when using box #188
Comments
For me, the following setup works:
For this to work out of the box, we would have to overwrite/shim |
Thanks it worked. I can trigger break points now. Is there a way to not write this line directly in the code : |
Hello I found that it does not work if I use main.R box::use(./src/test_module[ yeet, YeetClass ])
vscDebugger:::setStoredBreakpoints()
yeet() # this works
yeet_class <- YeetClass$new() # break point from inside function is not hit
print("done!") ./src/test_module.R box::use(R6)
#' @export
yeet <- function() {
print("Yeet")
}
#' @export
YeetClass <- R6$R6Class(
"YeetClass",
public = list(
initialize = function() {
print("YeetClass initialized") # <--- breakpoint using red dot gutter set here is never hit
}
)
) launch.json {
"version": "0.2.0",
"configurations": [
{
"type": "R-Debugger",
"name": "R test box modules",
"request": "launch",
"debugMode": "file",
"workingDirectory": "",
"file": "${workspaceFolder}/main.R",
"setBreakpointsInPackages": true
}
]
}
This issue seems to be related but I don't have enough background: #165 |
Error description
When using the box package to modularize code, breakpoints in VS Code's R Debugger do not seem to be triggered. This issue does not occur when using source() to load files. Since box isolates environments, it might be causing the debugger to lose track of the code context.
The function hello_world defined in func1.R runs correctly, but breakpoints set inside this function are not triggered when called
code to reproduce :
main.R
func1.R
R version
‘box’ version
'1.2.0'
The text was updated successfully, but these errors were encountered: