fix lack of auto-suggestion for aliases (#3249)

This commit is contained in:
Saeed Rasooli 2021-04-03 02:09:30 +04:30 committed by GitHub
parent f03f1949bf
commit e737222a5d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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<String> {
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);
}