From e737222a5ddb5f24edbc317c513828fb13e14d9e Mon Sep 17 00:00:00 2001 From: Saeed Rasooli Date: Sat, 3 Apr 2021 02:09:30 +0430 Subject: [PATCH] fix lack of auto-suggestion for aliases (#3249) --- crates/nu-engine/src/evaluate/scope.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crates/nu-engine/src/evaluate/scope.rs b/crates/nu-engine/src/evaluate/scope.rs index b34beb8fbd..fda0d400a7 100644 --- a/crates/nu-engine/src/evaluate/scope.rs +++ b/crates/nu-engine/src/evaluate/scope.rs @@ -103,6 +103,8 @@ impl Scope { for frame in self.frames.lock().iter() { let mut frame_command_names = frame.get_command_names(); + frame_command_names.extend(frame.get_alias_names()); + frame_command_names.extend(frame.get_custom_command_names()); names.append(&mut frame_command_names); } @@ -388,6 +390,10 @@ impl ScopeFrame { self.commands.keys().map(|x| x.to_string()).collect() } + pub fn get_custom_command_names(&self) -> Vec { + self.custom_commands.keys().map(|x| x.to_string()).collect() + } + pub fn add_command(&mut self, name: String, command: Command) { self.commands.insert(name, command); }