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
In the configuration.md documentation, section 3.1 (Launch Requests) says the following:
"workingDirectory": An absolute path to the desired work directory. Defaults to the workspace folder. The R process is always launched in the workspace folder (reading the .Rprofile there) and then changes directory.
From this fragment, I would expect R-debugger to:
Start always on the workspace folder ${workspaceFolder}.
Run the .Rprofile in the workspace folder (if any).
Switch working directory to that specified by the argument "workingDirectory" in the respective R-debugger configuration the user is running from launch.json file.
However, it seems like .Rprofile never gets to run if "workingDirectory" is not set to ${workspaceFolder}.
To Reproduce
For a dummy example, let the following be our project structure:
and then we proceed to launch R-debugger from file bye_world.R, the debugger will first run .Rprofile and then proceed with bye_world.R, just to obtain the expected output:
One would still expect R-debugger to run the .Rprofile, but that's not the case, as revealed by the output obtained by running the debugger from file bye_world.R, where we can see that MESSAGE variable never gets defined:
[1] ""
[1] "bye world!"
Is this the expected behaviour (and thus the documentation in configuration.md is a bit misleading), or should the debugger run .Rprofile despite the "workingDirectory" specified?
Desktop:
R Version: 4.2.2
vscDebugger Version: 0.5.2
vscode-r-debugger Version: 0.5.4
The text was updated successfully, but these errors were encountered:
Thanks for opening this issue and the detailed info. This is the intended behaviour. The documentation in configuration.md was outdated, sorry about that. eb4ebeb updates the documentation accordingly.
Hi there
In the configuration.md documentation, section 3.1 (Launch Requests) says the following:
From this fragment, I would expect R-debugger to:
${workspaceFolder}
."workingDirectory"
in the respective R-debugger configuration the user is running from launch.json file.However, it seems like .Rprofile never gets to run if
"workingDirectory"
is not set to${workspaceFolder}
.To Reproduce
For a dummy example, let the following be our project structure:
Let .Rprofile be:
Sys.setenv("MESSAGE" = "hello world!")
Let bye_world.R be:
If we let launch.json be:
and then we proceed to launch R-debugger from file bye_world.R, the debugger will first run .Rprofile and then proceed with bye_world.R, just to obtain the expected output:
However, if we let launch.json be:
One would still expect R-debugger to run the .Rprofile, but that's not the case, as revealed by the output obtained by running the debugger from file bye_world.R, where we can see that
MESSAGE
variable never gets defined:Is this the expected behaviour (and thus the documentation in configuration.md is a bit misleading), or should the debugger run .Rprofile despite the
"workingDirectory"
specified?Desktop:
The text was updated successfully, but these errors were encountered: