Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide_completion/src/completions/lifetime.rs')
| -rw-r--r-- | crates/ide_completion/src/completions/lifetime.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/ide_completion/src/completions/lifetime.rs b/crates/ide_completion/src/completions/lifetime.rs index 4082414f02..878d72ea0f 100644 --- a/crates/ide_completion/src/completions/lifetime.rs +++ b/crates/ide_completion/src/completions/lifetime.rs @@ -7,7 +7,7 @@ //! there is no value in lifting these out into the outline module test since they will either not //! show up for normal completions, or they won't show completions other than lifetimes depending //! on the fixture input. -use hir::ScopeDef; +use hir::{known, ScopeDef}; use syntax::ast; use crate::{ @@ -35,12 +35,12 @@ pub(crate) fn complete_lifetime(acc: &mut Completions, ctx: &CompletionContext) ctx.scope.process_all_names(&mut |name, res| { if let ScopeDef::GenericParam(hir::GenericParam::LifetimeParam(_)) = res { if param_lifetime != Some(&*name.to_smol_str()) { - acc.add_resolution(ctx, name, res); + acc.add_lifetime(ctx, name); } } }); if param_lifetime.is_none() { - acc.add_static_lifetime(ctx); + acc.add_lifetime(ctx, known::STATIC_LIFETIME); } } @@ -51,7 +51,7 @@ pub(crate) fn complete_label(acc: &mut Completions, ctx: &CompletionContext) { } ctx.scope.process_all_names(&mut |name, res| { if let ScopeDef::Label(_) = res { - acc.add_resolution(ctx, name, res); + acc.add_label(ctx, name); } }); } |