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

Update .rs.api.versionInfo() #531

Merged
merged 3 commits into from
Sep 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 29 additions & 15 deletions crates/ark/src/modules/rstudio/rstudioapi.R
Original file line number Diff line number Diff line change
@@ -1,20 +1,34 @@
#' @export
.rs.api.versionInfo <- function() {
# comments are what rstudioapi actually does
# https://github.com/rstudio/rstudio/blob/bb729e14867f6f95e26600d8b38e4551402cf7de/src/cpp/r/R/Api.R#L135-L145
# info <- list()

current_year <- format(Sys.Date(), "%Y")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL!

positron_citation <-
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor, do you think RStudio should have used https://posit.co/?

utils::bibentry(
"Manual",
title = "Positron: A next generation data science IDE",
author = utils::person("Posit team"),
organization = "Posit Software, PBC",
address = "Boston, MA",
year = current_year,
url = "https://www.posit.co/",
textVersion =
paste(
paste0("Posit team (", current_year, "). "),
"Positron: A next generation data science IDE. ",
"Posit Software, PBC, Boston, MA. ",
"URL https://www.posit.co/.",
sep = ""
),
mheader = "To cite Positron in publications use:",
mfooter = ""
)
class(positron_citation) <- c("citation", "bibentry")

list(
# info$citation <- .Call("rs_rstudioCitation", PACKAGE = "(embedding)")
citation = NULL,
# info$mode <- .Call("rs_rstudioProgramMode", PACKAGE = "(embedding)")
mode = "desktop",
# info$edition <- .Call("rs_rstudioEdition", PACKAGE = "(embedding)")
# info$version <- .Call("rs_rstudioVersion", PACKAGE = "(embedding)")
# info$version <- package_version(info$version)
version = package_version("2023.3"),
# info$long_version <- .Call("rs_rstudioLongVersion", PACKAGE = "(embedding)")
long_version = "2023.03.0"
# info$release_name <- .Call("rs_rstudioReleaseName", PACKAGE = "(embedding)")
citation = positron_citation,
mode = Sys.getenv("POSITRON_MODE"),
version = package_version(Sys.getenv("POSITRON_VERSION")),
long_version = Sys.getenv("POSITRON_LONG_VERSION"),
ark_version = .ps.ark.version()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought it might be nice to include the ark version here. Thoughts?

)
# info
}
Loading