Skip to content
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

Favour new RStudio env vars over existing heuristics #465

Closed
hadley opened this issue May 17, 2022 · 9 comments · Fixed by #471
Closed

Favour new RStudio env vars over existing heuristics #465

hadley opened this issue May 17, 2022 · 9 comments · Fixed by #471
Labels
feature a feature request or enhancement

Comments

@hadley
Copy link
Member

hadley commented May 17, 2022

rstudio/rstudio#11024

Obviously will want to keep heuristics for some time (probably several years), until this version of RStudio is in widespread usage.

@gaborcsardi gaborcsardi added the feature a feature request or enhancement label May 18, 2022
@hadley
Copy link
Member Author

hadley commented May 23, 2022

I think this should fix the problem with the "Run Tests" button in RStudio; currently when it's run cli::is_dynamic_tty() is FALSE so we get a sub-optimal display.

@gaborcsardi
Copy link
Member

Maybe. OTOH the current detection should also detect the build pane correctly, I believe, so maybe this is not the reason?

@romainfrancois
Copy link
Contributor

related to rstudio/rstudio#11281

@DavisVaughan
Copy link
Member

DavisVaughan commented May 24, 2022

A few concrete differences between Run Tests on a single file and CMD+SHIFT+T that hopefully can be resolved:

  • Run Tests doesn't have color
  • Run Tests links to files, like test-vec-case-when.R, but doesn't link snapshot_accept()

I'm on RStudio 2022.06.0-daily+385

Screen Shot 2022-05-23 at 6 37 16 PM

Screen Shot 2022-05-24 at 9 12 49 AM

@hadley
Copy link
Member Author

hadley commented May 24, 2022

If I install r-lib/rlang#1404 and devtools::document(), I don't see colour working in the build pane either, so I think the current heuristics fail for more than just "Test file".

@romainfrancois
Copy link
Contributor

For the links, I think it's related to the cli.num_colors option used in:

opt <- as.integer(getOption("cli.num_colors", NULL))[1]
at least this is what makes it return FALSE

@romainfrancois
Copy link
Contributor

Maybe ? related to local_reproducible_output(.env = )

https://github.com/r-lib/testthat/blob/0f24eae7bd2cd7d0fbe5a5492636731d66d0dd26/R/local.R#L106

@gaborcsardi
Copy link
Member

@hadley The "Run tests" button wasn't detected with the old methods, I fixed that as well in #471. I probably only looked at the commands in the Build menu....

@DavisVaughan What does CMD+SHIFT+T run?

@DavisVaughan
Copy link
Member

@gaborcsardi It runs devtools::test() in the Build pane (which I am fairly certain is in a new R session)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature a feature request or enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants