forked from extern/nushell
fix lack of auto-suggestion for aliases (#3249)
This commit is contained in:
parent
f03f1949bf
commit
e737222a5d
@ -103,6 +103,8 @@ impl Scope {
|
|||||||
|
|
||||||
for frame in self.frames.lock().iter() {
|
for frame in self.frames.lock().iter() {
|
||||||
let mut frame_command_names = frame.get_command_names();
|
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);
|
names.append(&mut frame_command_names);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -388,6 +390,10 @@ impl ScopeFrame {
|
|||||||
self.commands.keys().map(|x| x.to_string()).collect()
|
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) {
|
pub fn add_command(&mut self, name: String, command: Command) {
|
||||||
self.commands.insert(name, command);
|
self.commands.insert(name, command);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user