Skip to content

Recent changes to getVersion() cause some RStudio addins to fail in Positron #307

Closed
@ateucher

Description

@ateucher

I use codegrip::addin_reshape() and styler:::style_active_file() in both RStudio and Positron (bound to keyboard shortcuts). Both of these functions call rstudioapi::modifyRange(), which in turn calls rstudioapi::getVersion().

Recent changes in 3bd91a6 and 6a71e69 mean that getVersion() fails outside of RStudio:

In Positron:

rstudioapi::modifyRange(Map(c, 1:5, 1), paste0("#", sample(letters, 5), " "))
#> Error in base$.Call("rs_rstudioVersion", PACKAGE = "(embedding)"): "rs_rstudioVersion" not available for .Call() for package "(embedding)"

rstudioapi::getVersion()
#> Error in base$.Call("rs_rstudioVersion", PACKAGE = "(embedding)"): "rs_rstudioVersion" not available for .Call() for package "(embedding)"

Created on 2024-10-18 with reprex v2.1.1

I don't think these addins are officially supported in Positron, but I know there has been some work to ensure a certain subset of rstudioapi functions work in Positron, including modifyRange() (e.g., posit-dev/positron#1312 and posit-dev/positron#2582).

Apologies if this should be a Positron issue rather than rstudioapi.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions