Skip to content

Commit

Permalink
Add shim for rstudioapi::documentPath()
Browse files Browse the repository at this point in the history
  • Loading branch information
juliasilge committed Nov 26, 2024
1 parent f3fffe3 commit ffbceb1
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions crates/ark/src/modules/rstudio/document-api.R
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,17 @@
))
}

#' @export
.rs.api.documentPath <- function(id = NULL) {
# TODO: Support document IDs
stopifnot(is.null(id))

context <- .ps.ui.LastActiveEditorContext()
if (is.null(context)) {
return()
}
context$document$path
}

#' @export
.rs.api.getActiveDocumentContext <- function() {
Expand Down

0 comments on commit ffbceb1

Please sign in to comment.