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

Add rstudioapi shims for source markers #6073

Open
juliasilge opened this issue Jan 22, 2025 · 2 comments
Open

Add rstudioapi shims for source markers #6073

juliasilge opened this issue Jan 22, 2025 · 2 comments
Labels
enhancement New feature or request lang: r support
Milestone

Comments

@juliasilge
Copy link
Contributor

Originally posted by @etiennebacher in #6061:

I have a package where I use RStudio's source markers using rstudioapi::callFun("sourceMarkers", ...). Since this feature is not available in VS Code for instance, I put it behind rstudioapi::isAvailable(). However, it turns out that rstudioapi::isAvailable() returns TRUE in Positron, but source markers are not supported.

Will they be supported in the future? Alternatively, do I have a way to detect that the user is using Positron?

rstudioapi::isAvailable()
#> TRUE
rstudioapi::callFun("sourceMarkers")
#> Error:
#> ! Function sourceMarkers not found in RStudio
@juliasilge
Copy link
Contributor Author

For more information:

https://rstudio.github.io/rstudioapi/reference/sourceMarkers.html

I'll be honest that I'm not familiar with this one, and it does look less commonly used than some of the other rstudioapi shims we need to support.

@juliasilge juliasilge added enhancement New feature or request lang: r support labels Jan 22, 2025
@etiennebacher
Copy link

etiennebacher commented Jan 22, 2025

it does look less commonly used than some of the other rstudioapi shims we need to support.

Yes, to be honest I think I've only seen used in lintr (and I use it in flint) to report lints in a separate tab in RStudio.

Nit: the search for the usage could include rstudioapi::callFun("sourceMarkers", ...):
https://github.com/search?q=rstudioapi::sourceMarkers%20OR%20rstudioapi::callFun(%22sourceMarkers%22&type=code&rgh-link-date=2025-01-22T00:28:04Z

@juliasilge juliasilge added this to the Future milestone Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request lang: r support
Projects
None yet
Development

No branches or pull requests

2 participants