-
Notifications
You must be signed in to change notification settings - Fork 93
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
Understanding box
modules directory context
#5082
Comments
I don't think Positron or RStudio "understand" anything about box, so this is likely somehow an issue with box itself. Maybe @klmr can provide more insight though |
@DavisVaughan Correct; since R has no reliable way (!) of determining the currently executing script’s path, ‘box’ needs to hard-code support for each individual launcher. For RStudio, the relevant logic can be found in R/paths.r#L182-L220. Positron will need to expose a similar R API so that ‘box’ can support it. @GitHunter0 Could you please create a new feature request for ‘box’? |
For sure @klmr , just opened klmr/box#374 . |
@klmr could you use
The internal API fallback you are using there will not work though, as that is not officially supported |
There are unfortunately two issues with this approach:
|
Okay, I’ve tried it, and there’s yet another issue:
|
In Positron we override
To me, if rstudioapi is not installed, you cannot perform that action, full stop. That is the only official way to access that IDE support. Going through internal means to access it when in-rstudio-but-rstudioapi-is-not-installed is not something we can support |
Is 3 such a blocker right now? I feel like most people don't call that directly. Is there a use case I'm missing? |
3 might not be a blocker, but it would be nice if that worked. People definitely do use the terminal directly. I’ll use That said, I’ll keep the fallback for RStudio since that situation is actually very common: at least in every ‘renv’ project that I’ve worked with (nobody installs IDE utilities in their ‘renv’, nor should they; it could be configured via |
System details:
Positron and OS details:
Positron Version: 2024.11.0 (user setup) build 49
Code - OSS Version: 1.93.0
Commit: 10183fa
Date: 2024-10-15T02:46:25.016Z
Electron: 30.4.0
Chromium: 124.0.6367.243
Node.js: 20.15.1
V8: 12.4.254.20-electron.0
OS: Windows_NT x64 10.0.19045
Interpreter details:
R version 4.4.1 (2024-06-14 ucrt)
Platform: x86_64-w64-mingw32/x64
Running under: Windows 10 x64 (build 19045)
Describe the issue:
Hi folks / @klmr , please consider the MWE below.
We have
module1.R
,module2.R
and__initi__.R
files, all in directoryC:/project/modules/
, withC:/project/
being our R working directory.In RStudio, running
box::use(./module1[f1])
interactively frommodule2.R
works as expected.However, in Positron, it generates this error:
Which means
Positron
does not understand we are running a code from abox
module and therefore it should consider its directory as the reference, not the R working directory.Thank you
The text was updated successfully, but these errors were encountered: