don't include import path in args to aliased external commands (#14231)

Fixes #13776

# User-Facing Changes

Arguments to aliased externals no longer include nested import paths:

```diff
module foo { export alias bar = ^echo }
use foo
foo bar baz
-bar baz
+baz
```
This commit is contained in:
Solomon
2024-11-06 06:40:29 -07:00
committed by GitHub
parent 23fba6d2ea
commit cc0259bbed
2 changed files with 26 additions and 2 deletions

View File

@ -1343,10 +1343,10 @@ pub fn parse_call(working_set: &mut StateWorkingSet, spans: &[Span], head: Span)
trace!("parsing: alias of external call");
let mut head = head.clone();
head.span = spans[0]; // replacing the spans preserves syntax highlighting
head.span = Span::concat(&spans[cmd_start..pos]); // replacing the spans preserves syntax highlighting
let mut final_args = args.clone().into_vec();
for arg_span in &spans[1..] {
for arg_span in &spans[pos..] {
let arg = parse_external_arg(working_set, *arg_span);
final_args.push(arg);
}