From 0eb0be55a3bc8fbfaf033f0ffdc597e7e7955ee3 Mon Sep 17 00:00:00 2001 From: mattwparas Date: Sat, 26 Aug 2023 18:13:55 -0700 Subject: [PATCH] slim down interfact even more --- helix-term/src/commands.rs | 6 ------ helix-term/src/commands/engine.rs | 9 --------- helix-term/src/commands/engine/scheme.rs | 4 ++-- 3 files changed, 2 insertions(+), 17 deletions(-) diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs index 0df2bbe86..238902987 100644 --- a/helix-term/src/commands.rs +++ b/helix-term/src/commands.rs @@ -551,12 +551,6 @@ impl std::str::FromStr for MappableCommand { args, doc, }) - } else if self::engine::ScriptingEngine::is_exported(name) { - Some(MappableCommand::Typable { - name: name.to_owned(), - args, - doc: "plugin function".to_string(), - }) } else { None } diff --git a/helix-term/src/commands/engine.rs b/helix-term/src/commands/engine.rs index b8c89960d..d4200e1a0 100644 --- a/helix-term/src/commands/engine.rs +++ b/helix-term/src/commands/engine.rs @@ -99,10 +99,6 @@ impl ScriptingEngine { ) -> Vec<(String, i64)> { PLUGIN_SYSTEM.0.fuzzy_match(fuzzy_matcher, input) } - - pub fn is_exported(ident: &str) -> bool { - PLUGIN_SYSTEM.0.is_exported(ident) - } } impl PluginSystem for NoEngine {} @@ -174,9 +170,4 @@ pub trait PluginSystem { ) -> Vec<(String, i64)> { Vec::new() } - - /// Checks if this identifier is available in the global environment in the engine. - fn is_exported(&self, _ident: &str) -> bool { - false - } } diff --git a/helix-term/src/commands/engine/scheme.rs b/helix-term/src/commands/engine/scheme.rs index d1156aee8..117a54b44 100644 --- a/helix-term/src/commands/engine/scheme.rs +++ b/helix-term/src/commands/engine/scheme.rs @@ -345,7 +345,9 @@ impl super::PluginSystem for SteelScriptingEngine { .map(|x| (x.0.to_string(), x.1)) .collect::>() } +} +impl SteelScriptingEngine { fn is_exported(&self, ident: &str) -> bool { EXPORTED_IDENTIFIERS .identifiers @@ -353,9 +355,7 @@ impl super::PluginSystem for SteelScriptingEngine { .unwrap() .contains(ident) } -} -impl SteelScriptingEngine { // Attempt to fetch the keymap for the extension fn get_keymap_for_extension<'a>(cx: &'a mut Context) -> Option { // Get the currently activated extension, also need to check the