mirror of
https://github.com/nushell/nushell.git
synced 2025-05-31 23:26:11 +02:00
doc: todo comment about variable shadowing
This commit is contained in:
parent
aff75c7d93
commit
7915e14463
@ -161,8 +161,10 @@ fn try_find_id_in_use(
|
|||||||
.get(name)
|
.get(name)
|
||||||
.cloned()
|
.cloned()
|
||||||
.or_else(|| {
|
.or_else(|| {
|
||||||
// NOTE: for module record variable: https://www.nushell.sh/book/modules/using_modules.html#importing-constants
|
// TODO: This is for the module record variable:
|
||||||
// the definition span is located at the head of the use command
|
// https://www.nushell.sh/book/modules/using_modules.html#importing-constants
|
||||||
|
// The definition span is located at the head of the `use` command.
|
||||||
|
// This method won't work if the variable is later shadowed by a new definition.
|
||||||
let var_id = working_set.find_variable(name)?;
|
let var_id = working_set.find_variable(name)?;
|
||||||
call.span()
|
call.span()
|
||||||
.contains_span(working_set.get_variable(var_id).declaration_span)
|
.contains_span(working_set.get_variable(var_id).declaration_span)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user