mirror of
https://github.com/nushell/nushell.git
synced 2025-08-09 05:04:40 +02:00
Improve alias highlighting/completions (#3594)
* Improve alias highlighting/completions * Add example
This commit is contained in:
@ -1826,16 +1826,6 @@ fn parse_call(
|
||||
let (_, expr, err) = parse_math_expression(0, &lite_cmd.parts[..], scope, false);
|
||||
error = error.or(err);
|
||||
return (Some(ClassifiedCommand::Expr(Box::new(expr))), error);
|
||||
} else if lite_cmd.parts[0].item == "alias" {
|
||||
let error = parse_alias(&lite_cmd, scope);
|
||||
if error.is_none() {
|
||||
return (None, None);
|
||||
} else {
|
||||
return (
|
||||
Some(ClassifiedCommand::Expr(Box::new(garbage(lite_cmd.span())))),
|
||||
error,
|
||||
);
|
||||
}
|
||||
} else if lite_cmd.parts.len() > 1 {
|
||||
// Check if it's a sub-command
|
||||
if let Some(signature) = scope.get_signature(&format!(
|
||||
@ -1899,6 +1889,13 @@ fn parse_call(
|
||||
)),
|
||||
);
|
||||
}
|
||||
} else if lite_cmd.parts[0].item == "alias" {
|
||||
let error = parse_alias(&lite_cmd, scope);
|
||||
if error.is_none() {
|
||||
return (Some(ClassifiedCommand::Internal(internal_command)), None);
|
||||
} else {
|
||||
return (Some(ClassifiedCommand::Internal(internal_command)), error);
|
||||
}
|
||||
}
|
||||
|
||||
error = error.or(err);
|
||||
|
Reference in New Issue
Block a user