klmr / klmr/box

Breakpoints not triggered in VS Code R Debugger when using box

Open
#372 2 comments 0 reactions 0 assignees View on GitHub
⚠️ bug
Dominant language
R
Stars
979
Forks
49
PR merge metrics
No merged PRs in 30d

Description

### 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_
```
box::use(
. / func1[hello_world]
)

hello_world()
```

_func1.R_
```
#' @export
hello_world <- function(){
x = c(1,2,3) # Breakpoint added here
print("In here")
return("Hello World")
}
```

```
R Debugger Version - v0.5.5
```

_Don't know if this is the right place to open this issue_

### R version

```plain text
platform x86_64-w64-mingw32
arch x86_64
os mingw32
crt ucrt
system x86_64, mingw32
status
major 4
minor 4.1
year 2024
month 06
day 14
svn rev 86737
language R
version.string R version 4.4.1 (2024-06-14 ucrt)
nickname Race for Your Life
```

### ‘box’ version

'1.2.0'

Contributor guide

Open the contributing guide

Research direction

Start with _main.R and _func1.R, reproduce the call through box::use and hello_world() using the reported R 4.4.1, box 1.2.0, and VS Code R Debugger v0.5.5 versions. Compare breakpoint behavior with the stated source() case; done means breakpoints inside hello_world are triggered when it is called through box.

Written by the indexing model from the issue text.

Assessment

Tech stack
r, vscode
Domain
developer-experience, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.