diff --git a/crates/ide_completion/src/completions/unqualified_path.rs b/crates/ide_completion/src/completions/unqualified_path.rs index 5d0eee08ee1..905ea648877 100644 --- a/crates/ide_completion/src/completions/unqualified_path.rs +++ b/crates/ide_completion/src/completions/unqualified_path.rs @@ -306,4 +306,25 @@ pub mod prelude { "#]], ); } + + #[test] + fn local_variable_shadowing() { + // FIXME: this isn't actually correct, should emit `x` only once. + check( + r#" +fn main() { + let x = 92; + { + let x = 92; + x$0; + } +} +"#, + expect![[r#" + lc x i32 + lc x i32 + fn main() fn() + "#]], + ); + } }