Skip to content
Open
Show file tree
Hide file tree
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
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@

## Unreleased

v3.0.0 of the R Extension for VS code is a major release. It introduces a
significant architectural change via the
[**`sess`**](https://github.com/REditorSupport/vscode-R/tree/master/sess) R
Package, which powers faster and more robust communication with the underlying R
session. In turn, this enables a variety of ancillary improvements and feature
requests, which we hope to continue building on. The extension will
automatically prompt users to install `sess` (on their behalf) if it is not
detected.

### Bug Fixes

* fix(rstudioapi): resolve emulation issues and viewer routing
Expand Down
1 change: 1 addition & 0 deletions sess/.Rbuildignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
^\.lintr$
28 changes: 22 additions & 6 deletions sess/DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,13 +1,28 @@
Package: sess
Type: Package
Title: Modern R IPC Server
Title: High-Performance IPC Bridge for R Sessions
Version: 3.0.0
Author: Gemini
Maintainer: Gemini <gemini@example.com>
Description: Implements a high-performance IPC client for R sessions using Unix domain sockets and Windows named pipes. Replaces legacy file-system watcher based workflows while keeping JSON-RPC communication semantics for IDE/editor integration.
License: MIT
Authors@R: c(
person(given = "Randy",
family = "Lai",
role = c("aut", "cre"),
email = "randy.cs.lai@gmail.com"),
person(given = "Kun",
family = "Ren",
role = "ctb"),
person(given = "Grant",
family = "McDermott",
role = "ctb"),
person(given = "Tatsuya",
family = "Shima",
role = "ctb"),
person(given = "Fred",
family = "Wu",
role = "ctb")
)
Description: Implements a high-performance IPC bridge for R sessions using Unix domain sockets and Windows named pipes. Replaces legacy file-system watcher based workflows while keeping JSON-RPC communication semantics for IDE/editor integration.
License: MIT + file LICENSE
Encoding: UTF-8
LazyData: true
Imports:
processx (>= 3.5.0),
later,
Expand All @@ -17,6 +32,7 @@ Imports:
rstudioapi
Suggests:
bit64,
httpgd,
jgd,
svglite,
tinytest
Expand Down
2 changes: 2 additions & 0 deletions sess/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
YEAR: 2025
COPYRIGHT HOLDER: REditorSupport
22 changes: 19 additions & 3 deletions sess/R/hooks.R
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,21 @@ register_hooks <- function(use_rstudioapi = TRUE, use_httpgd = TRUE, use_jgd = F
)

# 3. Help System Interception
# Capture utils' own print methods before registering ours over them, so the
# fallbacks below do not need ::: to reach unexported internals.
if (is.null(.sess_env$orig_print_help_files)) {
.sess_env$orig_print_help_files <- utils::getS3method(
"print", "help_files_with_topic",
envir = asNamespace("utils")
)
}
if (is.null(.sess_env$orig_print_hsearch)) {
.sess_env$orig_print_hsearch <- utils::getS3method(
"print", "hsearch",
envir = asNamespace("utils")
)
}

sess_print.help_files_with_topic <- function(x, ...) {
if (length(x) >= 1 && is.character(x)) {
file <- x[1]
Expand All @@ -104,7 +119,7 @@ register_hooks <- function(use_rstudioapi = TRUE, use_httpgd = TRUE, use_jgd = F
viewer = getOption("sess.helpPanel", "Two")
))
} else {
utils:::print.help_files_with_topic(x, ...)
.sess_env$orig_print_help_files(x, ...)
}
invisible(x)
}
Expand All @@ -115,13 +130,14 @@ register_hooks <- function(use_rstudioapi = TRUE, use_httpgd = TRUE, use_jgd = F

sess_print.hsearch <- function(x, ...) {
if (length(x) >= 1) {
requestPath <- paste0("/doc/html/Search?pattern=", tools:::escapeAmpersand(x$pattern))
pattern <- gsub("&", "&amp;", x$pattern, fixed = TRUE)
requestPath <- paste0("/doc/html/Search?pattern=", pattern)
notify_client("help", list(
requestPath = requestPath,
viewer = getOption("sess.helpPanel", "Two")
))
} else {
utils:::print.hsearch(x, ...)
.sess_env$orig_print_hsearch(x, ...)
}
invisible(x)
}
Expand Down
2 changes: 1 addition & 1 deletion sess/R/rstudioapi.R
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ serialize_location <- function(location) {
}

namespace_has <- function(obj, namespace) {
attempt <- try(getFromNamespace(obj, namespace), silent = TRUE)
attempt <- try(utils::getFromNamespace(obj, namespace), silent = TRUE)
!inherits(attempt, "try-error")
}

Expand Down
Loading
Loading