Skip to content

Commit a9d9750

Browse files
authored
Merge pull request #1730 from REditorSupport/pre-release-chores
2 parents 42ba3c0 + 6ed9948 commit a9d9750

3 files changed

Lines changed: 28 additions & 3 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
* fix(rstudioapi): resolve emulation issues and viewer routing
88
* fix(liveshare): resolve activation errors, file reading bugs, and add hooks for sess compatibility
9+
* fix(workspace): fix code submission delays when the workspace contains many or large objects
910

1011
### Features
1112

@@ -16,6 +17,9 @@
1617
* feat(session): implement file-based reconnection and suppress verbose logs
1718
* feat(plot): new `r.plot.backend` enum setting for finer-grained control of the preferred plotting backend, including integration with the lightweight `jgd` graphics device (default if installed). `r.plot.useHttpgd` is still respected, but may be deprecated in a future release.
1819
* feat(term): new `r.rterm.preferredConsoles` enum setting enables for string-based R console selection (`"R"` (default), `"arf"`, and/or `"radian"`), automatically resolved against the user's `PATH`. `r.term.<os>` is still respected (and prioritized) if provided.
20+
* feat(dataview): keep one viewer per data name, refreshing the existing viewer on repeated `View()` calls
21+
* feat(dataview): load data rows on demand while scrolling, with support for Arrow and Polars DataFrames
22+
* feat(workspace): support recursive expansion of nested lists, environments, pairlists, S4 objects, and data frames
1923

2024
### Performance
2125

@@ -24,6 +28,7 @@
2428
### Other
2529

2630
* Remove the unused `r.workspaceViewer.showObjectSize` setting and obsolete object-size tooltip support
31+
* Remove obsolete `r.session.objectLengthLimit`, `r.session.objectTimeout`, and `r.session.levelOfObjectDetail` settings following the switch to on-demand workspace inspection
2732

2833
### Styling
2934

‎sess/R/handlers.R‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,13 @@ try_capture_str <- function(object, max_level = 0L) {
1717
)
1818
}
1919

20+
workspace_env_names <- function(env) {
21+
ls(env, sorted = FALSE)
22+
}
23+
2024
workspace_child_count <- function(object) {
2125
if (is.environment(object)) {
22-
length(object)
26+
length(workspace_env_names(object))
2327
} else if (isS4(object)) {
2428
length(methods::slotNames(object))
2529
} else if (typeof(object) %in% c("list", "pairlist")) {
@@ -31,7 +35,7 @@ workspace_child_count <- function(object) {
3135

3236
get_workspace_data <- function() {
3337
env <- .GlobalEnv
34-
all_names <- ls(env, sorted = FALSE)
38+
all_names <- workspace_env_names(env)
3539

3640
objs <- lapply(all_names, function(name) {
3741
if (bindingIsActive(name, env)) {
@@ -141,7 +145,7 @@ get_workspace_children <- function(name, path = list(), start = 1L) {
141145
}
142146

143147
children <- if (is.environment(object)) {
144-
child_names <- ls(object, sorted = FALSE)[seq.int(start, end)]
148+
child_names <- workspace_env_names(object)[seq.int(start, end)]
145149
lapply(child_names, function(child_name) {
146150
if (bindingIsActive(child_name, object)) {
147151
list(

‎sess/inst/tinytest/test-ipc.R‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,22 @@ local({
5050
expect_false(isTRUE(result))
5151
})
5252

53+
# Environment expansion must retain visible members when hidden bindings exist (R6).
54+
local({
55+
name <- basename(tempfile("workspace_environment_"))
56+
object <- new.env(parent = emptyenv())
57+
object$values <- list(first = 1L)
58+
object$.hidden <- TRUE
59+
assign(name, object, envir = .GlobalEnv)
60+
on.exit(rm(list = name, envir = .GlobalEnv), add = TRUE)
61+
62+
page <- sess:::get_workspace_children(name)
63+
expect_equal(
64+
lapply(page$children, function(child) child$selector),
65+
list(list(kind = "name", value = "values"))
66+
)
67+
})
68+
5369
# dataview init/page/dispose lifecycle works
5470
local({
5571
.sess_env <- sess:::.sess_env

0 commit comments

Comments
 (0)