mirror of
https://github.com/nushell/nushell.git
synced 2025-08-12 09:00:17 +02:00
Fix scoped overlay use
not finding a module (#6474)
* Add source-env test for dynamic path * Use correct module ID for env overlay imports * Remove parser check from "overlay list" It would cause unnecessary errors from some inner scope if some overlay module was also defined in some inner scope. * Restore Cargo.lock back * Remove comments
This commit is contained in:
@ -82,6 +82,10 @@ impl Call {
|
||||
self.positional_iter().nth(i)
|
||||
}
|
||||
|
||||
pub fn positional_nth_mut(&mut self, i: usize) -> Option<&mut Expression> {
|
||||
self.positional_iter_mut().nth(i)
|
||||
}
|
||||
|
||||
pub fn positional_len(&self) -> usize {
|
||||
self.positional_iter().count()
|
||||
}
|
||||
|
@ -39,6 +39,7 @@ pub enum Expr {
|
||||
CellPath(CellPath),
|
||||
FullCellPath(Box<FullCellPath>),
|
||||
ImportPattern(ImportPattern),
|
||||
Overlay(Option<BlockId>), // block ID of the overlay's origin module
|
||||
Signature(Box<Signature>),
|
||||
StringInterpolation(Vec<Expression>),
|
||||
Nothing,
|
||||
|
@ -169,6 +169,7 @@ impl Expression {
|
||||
false
|
||||
}
|
||||
Expr::ImportPattern(_) => false,
|
||||
Expr::Overlay(_) => false,
|
||||
Expr::Filepath(_) => false,
|
||||
Expr::Directory(_) => false,
|
||||
Expr::Float(_) => false,
|
||||
@ -337,6 +338,7 @@ impl Expression {
|
||||
.replace_in_variable(working_set, new_var_id);
|
||||
}
|
||||
Expr::ImportPattern(_) => {}
|
||||
Expr::Overlay(_) => {}
|
||||
Expr::Garbage => {}
|
||||
Expr::Nothing => {}
|
||||
Expr::GlobPattern(_) => {}
|
||||
@ -485,6 +487,7 @@ impl Expression {
|
||||
.replace_span(working_set, replaced, new_span);
|
||||
}
|
||||
Expr::ImportPattern(_) => {}
|
||||
Expr::Overlay(_) => {}
|
||||
Expr::Garbage => {}
|
||||
Expr::Nothing => {}
|
||||
Expr::GlobPattern(_) => {}
|
||||
|
Reference in New Issue
Block a user