VSCode-R-Debugger icon indicating copy to clipboard operation
VSCode-R-Debugger copied to clipboard

incompatible with targets

Open xinstein opened this issue 3 years ago • 1 comments

NOTE: Before submitting an issue, please make sure to install the latest version of both the vscode extension and the R package. This can usually be achieved by running the command r.debugger.updateRPackage in vscode's command palette (F1).

Describe the bug Can't debug code that uses the targets r package

To Reproduce

  1. get an example project from the targets official website.
  2. write an entrance script containing tar_make(target_name, callr_function = NULL)
  3. no targets are run, different behaviour than run in a console.

Your R code

Your Launch config If applicable, the launch config that causes the bug. E.g.:

        {
            "name": "R: tar_make",
            "debugMode": "file",
            "type": "R-Debugger",
            "request": "launch",
            "file": "tar_make.R",
            "workingDirectory": "${workspaceFolder}",
            "allowGlobalDebugging": false,
            "debuggedPackages": ["targets",],
            "commandLineArgs": [
                "--vanilla"
            ],
        }

Expected behavior

  1. the target target_name should be run as it does when invoked by Rscript;
  2. Breakpoints and browser() calls should enter me into the debug console.

Actual behavior no targets are run as if no targets have been specified.

Desktop (please complete the following information):

  • OS: windows 10
  • R Version: 4.1
  • vscDebugger Version: 0.4.7
  • vscode-r-debugger Version: 0.4.7

Additional context Add any other context about the problem here.

xinstein avatar Sep 17 '21 07:09 xinstein

If I remove the callr_function = NULL (the targets official way of debugging code), the targets are run normally but no debugging functionality works.

xinstein avatar Sep 17 '21 07:09 xinstein