diff --git a/crates/ark/src/methods.rs b/crates/ark/src/methods.rs index d8ed1cd93..02c3135d2 100644 --- a/crates/ark/src/methods.rs +++ b/crates/ark/src/methods.rs @@ -79,7 +79,7 @@ impl ArkGenerics { pub fn register_method(&self, class: &str, method: RObject) -> anyhow::Result<()> { let generic_name: &str = self.into(); - RFunction::new("", ".ark.register_ark_method") + RFunction::new("", ".ark.register_method") .add(RObject::try_from(generic_name)?) .add(RObject::try_from(class)?) .add(method) diff --git a/crates/ark/src/modules/positron/methods.R b/crates/ark/src/modules/positron/methods.R index 97ac892e8..f64c0735b 100644 --- a/crates/ark/src/modules/positron/methods.R +++ b/crates/ark/src/modules/positron/methods.R @@ -18,7 +18,7 @@ lockEnvironment(ark_methods_table, TRUE) #' @param class Class name as a character #' @param method A method to be registered. Should be a call object. #' @export -.ark.register_ark_method <- function(generic, class, method) { +.ark.register_method <- function(generic, class, method) { stopifnot( is_string(generic), generic %in% names(ark_methods_table), diff --git a/crates/ark/src/variables/variable.rs b/crates/ark/src/variables/variable.rs index a70968256..facaefa04 100644 --- a/crates/ark/src/variables/variable.rs +++ b/crates/ark/src/variables/variable.rs @@ -1377,20 +1377,20 @@ mod tests { // Register the display value method harp::parse_eval_global( r#" - .ark.register_ark_method("ark_positron_variable_display_value", "foo", function(x, width) { + .ark.register_method("ark_positron_variable_display_value", "foo", function(x, width) { # We return a large string and make sure it gets truncated. paste0(rep("a", length.out = 2*width), collapse="") }) - .ark.register_ark_method("ark_positron_variable_display_type", "foo", function(x, include_length) { + .ark.register_method("ark_positron_variable_display_type", "foo", function(x, include_length) { paste0("foo (", length(x), ")") }) - .ark.register_ark_method("ark_positron_variable_has_children", "foo", function(x) { + .ark.register_method("ark_positron_variable_has_children", "foo", function(x) { FALSE }) - .ark.register_ark_method("ark_positron_variable_kind", "foo", function(x) { + .ark.register_method("ark_positron_variable_kind", "foo", function(x) { "other" })