posit-dev / positron

Positron, a next-generation data science IDE
Other
2.32k stars 68 forks source link

Update .rs.api.versionInfo to describe the mode where Positron is running an R session #4081

Open petetronic opened 1 month ago

petetronic commented 1 month ago

Some R packages today depend on metadata from .rs.api.versionInfo() to determine whether a session is running in desktop or server, and whether it is a professional edition product. Positron will need to offer a compatible way to determine this information.

petetronic commented 1 month ago

Example output from Workbench + RStudio session:

> .rs.api.versionInfo()

$citation
To cite RStudio in publications use:

  Posit team (2024). RStudio: Integrated Development Environment for R. Posit Software, PBC, Boston, MA. URL http://www.posit.co/.

A BibTeX entry for LaTeX users is

  @Manual{,
    title = {RStudio: Integrated Development Environment for R},
    author = {{Posit team}},
    organization = {Posit Software, PBC},
    address = {Boston, MA},
    year = {2024},
    url = {http://www.posit.co/},
  }

$mode
[1] "server"

$edition
[1] "Professional"

$version
[1] ‘2024.4.1.748.2’

$long_version
[1] "2024.04.1+748.pro2"

$release_name
[1] "Chocolate Cosmos"
petetronic commented 1 month ago

Note: Positron also currently passes information to a kernel to describe if the session is supporting a notebook. We should be careful to reconcile terminology here.

petetronic commented 1 month ago

A stub for this appears to be here, but is currently stale: https://github.com/posit-dev/ark/blob/0.1.117/crates/ark/src/modules/rstudio/rstudioapi.R