Hide synthetic locals from completions

This commit is contained in:
Lukas Wirth 2025-01-04 16:48:08 +01:00
parent db55d9ade0
commit bf7597cd5a
3 changed files with 85 additions and 0 deletions

View file

@ -754,6 +754,11 @@ impl<'a> CompletionContext<'a> {
let mut locals = FxHashMap::default();
scope.process_all_names(&mut |name, scope| {
if let ScopeDef::Local(local) = scope {
// synthetic names currently leak out as we lack synthetic hygiene, so filter them
// out here
if name.as_str().starts_with('<') {
return;
}
locals.insert(name, local);
}
});