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 hyperlink in warn_roxy_tag() + warn_roxy_block() #1323

Closed
hadley opened this issue Apr 8, 2022 · 0 comments · Fixed by #1335
Closed

Use hyperlink in warn_roxy_tag() + warn_roxy_block() #1323

hadley opened this issue Apr 8, 2022 · 0 comments · Fixed by #1335
Milestone

Comments

@hadley
Copy link
Member

hadley commented Apr 8, 2022

Something like this:

warn_roxy_tag <- function(tag, message, ...) {
  link <- cli::style_hyperlink(
    paste0(basename(tag$file), ":", tag$line),
    paste0("file://", tag$file),
    params = c(line = tag$line, col = 1)
  )

  message[[1]] <- paste0(
    "[", link, "]", " @", tag$tag, " ",
    if (is.null(tag$raw)) ("(automatically generated) "),
    message[[1]]
  )
  cli::cli_warn(message, ..., .envir = parent.frame())
}
@hadley hadley added this to the v7.1.3 milestone Apr 8, 2022
hadley added a commit that referenced this issue Apr 20, 2022
hadley added a commit that referenced this issue Apr 25, 2022
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 a pull request may close this issue.

1 participant