mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-11-01 04:18:20 +00:00
Hide synthetic locals from completions
This commit is contained in:
parent
db55d9ade0
commit
bf7597cd5a
3 changed files with 85 additions and 0 deletions
|
|
@ -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);
|
||||
}
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue