mirror of
https://github.com/nushell/nushell.git
synced 2025-07-01 07:00:37 +02:00
Hide alias (#4432)
* Add alias interning Now, AliasId is used to reference aliases stored in EngineState, similar to decls, blocks, etc. * Fix wrong message * Fix using decl instead of alias * Extend also alias id visibility * Merge also aliases from delta * Add alias hiding code Does not work yet but passes tests at least. * Fix wrong alias lookup and visibility appending * Add hide alias tests * Fmt & Clippy * Fix random clippy warnings in "which" command
This commit is contained in:
@ -828,9 +828,11 @@ pub fn parse_call(
|
||||
|
||||
if expand_aliases {
|
||||
// If the word is an alias, expand it and re-parse the expression
|
||||
if let Some(expansion) = working_set.find_alias(&name) {
|
||||
if let Some(alias_id) = working_set.find_alias(&name) {
|
||||
trace!("expanding alias");
|
||||
|
||||
let expansion = working_set.get_alias(alias_id);
|
||||
|
||||
let orig_span = spans[pos];
|
||||
let mut new_spans: Vec<Span> = vec![];
|
||||
new_spans.extend(&spans[0..pos]);
|
||||
|
Reference in New Issue
Block a user