mirror of
https://github.com/nushell/nushell.git
synced 2025-07-01 07:00:37 +02:00
Fix command name lookup for known externals (#7830)
Fixes https://github.com/nushell/nushell/issues/7822
This commit is contained in:
@ -585,6 +585,24 @@ impl EngineState {
|
||||
None
|
||||
}
|
||||
|
||||
pub fn find_decl_name(&self, decl_id: DeclId, removed_overlays: &[Vec<u8>]) -> Option<&[u8]> {
|
||||
let mut visibility: Visibility = Visibility::new();
|
||||
|
||||
for overlay_frame in self.active_overlays(removed_overlays).iter().rev() {
|
||||
visibility.append(&overlay_frame.visibility);
|
||||
|
||||
if visibility.is_decl_id_visible(&decl_id) {
|
||||
for ((name, _), id) in overlay_frame.decls.iter() {
|
||||
if id == &decl_id {
|
||||
return Some(name);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
None
|
||||
}
|
||||
|
||||
pub fn find_alias(&self, name: &[u8], removed_overlays: &[Vec<u8>]) -> Option<AliasId> {
|
||||
let mut visibility: Visibility = Visibility::new();
|
||||
|
||||
|
Reference in New Issue
Block a user