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

Use more generic x-r-run over ide:run #1604

Merged
merged 1 commit into from
Apr 19, 2024

Conversation

DavisVaughan
Copy link
Member

I was going to switch us away from style_hyperlink() entirely in favor of format_inline("{.run ...}"), but it produces some weird text when in the fallback case

  • style_hyperlink() returns text unchanged in the fallback case
  • .run {text} returns text styled as {.code } in the fallback case, i.e. it backticks it

So in the fallback case, if you combine .run {text} (backticks) with our usage of {.path } (single quotes) below, then you end up with Writing '`a.Rd`'. It seems better to just continue to manually use style_hyperlink() so we have complete control over the fallback view. This case is covered by a test, which is how I learned about it in the first place.

roxygen2/R/utils.R

Lines 90 to 93 in db4dd9a

if (!is.null(href)) {
name <- cli::style_hyperlink(name, href)
}
cli::cli_inform("Writing {.path {name}}")

@DavisVaughan
Copy link
Member Author

The test failures look unrelated but do look like some kind of regressions that should probably be figured out first, in particular this error message looks worse all of a sudden

Last 13 lines of output:
  -   Quitting from lines 2-3 [unnamed-chunk-2] (<temp-path.Rmd>)
  +   Quitting from lines  at lines 2-3 [unnamed-chunk-2] (<temp-path.Rmd>)
      
  -   Quitting from lines 2-3 [unnamed-chunk-1] (<temp-path.Rmd>)
  +   Quitting from lines  at lines 2-3 [unnamed-chunk-1] (<temp-path.Rmd>)
      x <text>:3: @includeRmd failed to evaluate '<temp-path.Rmd>'.
      Caused by error:
      ! Error
  
  * Run `testthat::snapshot_accept('rd-include-rmd')` to accept the change.
  * Run `testthat::snapshot_review('rd-include-rmd')` to interactively review the change.

i.e. Quitting from lines at lines 2-3

@olivroy
Copy link
Contributor

olivroy commented Apr 10, 2024

@DavisVaughan Caused by xfun. Solved in dev yihui/xfun@1182e51

@DavisVaughan DavisVaughan merged commit 2357de6 into r-lib:main Apr 19, 2024
2 of 12 checks passed
@DavisVaughan DavisVaughan deleted the fix/x-r-run branch April 19, 2024 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants