-
Notifications
You must be signed in to change notification settings - Fork 130
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
Differentiate methods/functions or fields in autocompletion for R6 class. #999
Comments
Just would like to check whether it is something easy to change? |
Currently, we write out the The main difference here is only accessing get_names <- function(obj) {
names(obj)
}
get_names_and_types <- function(obj) {
names <- names(obj)
vapply(names, function(name) {
typeof(obj[[name]])
}, character(1L))
} For an object with many elements (e.g. env <- baseenv()
get_names(env)
get_names_and_types(env)
microbenchmark::microbenchmark(
get_names(env),
get_names_and_types(env)
)
But for small objects like a typical R6 classes, the performance difference is quite significant: tsk <- mlr3::tsk("iris")
microbenchmark::microbenchmark(
get_names(tsk),
get_names_and_types(tsk)
)
If our environment contains many objects like this, there will be obviously a notable delay on each user input given the current session watcher mechanism. |
Have we ever looked at saving a minimal globalenv representation + decompressing extension-side? E.g., using the protobuf format |
If we have a vscode interactive window suggested in #700 which is built on top of a fully managed background R session, then it seems to be easier to manage these connections and conduct on-demand operations with the R session. |
This issue is stale because it has been open for 365 days with no activity. |
This issue was closed because it has been inactive for 14 days since being marked as stale. |
mlr3 is implemented with R6 class. However, after creating a task, all autocompletes appear to be fields. Some of them actually should be methods, such as
data
in the screenshot below.Can these be differentiated within VSCode?
The text was updated successfully, but these errors were encountered: