diff --git a/R/zzz.R b/R/zzz.R new file mode 100644 index 0000000..38854c6 --- /dev/null +++ b/R/zzz.R @@ -0,0 +1,33 @@ +.onLoad <- function(libname, pkgname) { + register_ark_methods() +} + +register_ark_methods <- function() { + tryCatch( + { + register <- get(".ark.register_method", envir = globalenv()) + + register( + "ark_positron_variable_has_viewer", + "connConnection", + function(x) TRUE + ) + + register( + "ark_positron_variable_kind", + "connConnection", + function(x) "connection" + ) + + register( + "ark_positron_variable_view", + "connConnection", + function(x) { + connection_view(x) + TRUE + } + ) + }, + error = function(e) {} + ) +}