-
Notifications
You must be signed in to change notification settings - Fork 77
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
R environment pane: named list expansion #354
Conversation
extensions/positron-r/amalthea/crates/ark/src/environment/variable.rs
Outdated
Show resolved
Hide resolved
extensions/positron-r/amalthea/crates/ark/src/environment/variable.rs
Outdated
Show resolved
Hide resolved
extensions/positron-r/amalthea/crates/ark/src/environment/r_environment.rs
Outdated
Show resolved
Hide resolved
extensions/positron-r/amalthea/crates/ark/src/environment/r_environment.rs
Outdated
Show resolved
Hide resolved
extensions/positron-r/amalthea/crates/ark/src/environment/variable.rs
Outdated
Show resolved
Hide resolved
extensions/positron-r/amalthea/crates/ark/src/environment/variable.rs
Outdated
Show resolved
Hide resolved
extensions/positron-r/amalthea/crates/ark/src/environment/variable.rs
Outdated
Show resolved
Hide resolved
} | ||
|
||
.ps.environment_extract <- function(env, path) { | ||
object <- env |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: the usages above seem to imply this function returns an R list, but it seems like it's returning an environment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It actually returns whatever the path means, i.e. if we have c("foo", "bar", "[[1]]")
then it will return <env>$foo$bar[[1]]
but this function is a temporary thing anyway, this will need eventually to be more careful if e.g. <env>$foo
is an environment and bar
is an active binding or a promise in this environment etc ...
I think the function will eventually be replaced by some rust logic.
extensions/positron-r/amalthea/crates/ark/src/lsp/modules/public/environment.R
Outdated
Show resolved
Hide resolved
extensions/positron-r/amalthea/crates/ark/src/lsp/modules/public/environment.R
Outdated
Show resolved
Hide resolved
Merging this now, but carrying on ... |
This is very minimal and limited so far, i.e. only lists can be expanded (this includes data.frames), but at least this wires things for Inspect and Details messages.