Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide-completion/src/completions/flyimport.rs')
| -rw-r--r-- | crates/ide-completion/src/completions/flyimport.rs | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/crates/ide-completion/src/completions/flyimport.rs b/crates/ide-completion/src/completions/flyimport.rs index 2cf87baf33..b350647b9a 100644 --- a/crates/ide-completion/src/completions/flyimport.rs +++ b/crates/ide-completion/src/completions/flyimport.rs @@ -108,10 +108,10 @@ use crate::{ // The feature can be forcefully turned off in the settings with the `rust-analyzer.completion.autoimport.enable` flag. // Note that having this flag set to `true` does not guarantee that the feature is enabled: your client needs to have the corresponding // capability enabled. -pub(crate) fn import_on_the_fly_path( +pub(crate) fn import_on_the_fly_path<'db>( acc: &mut Completions, - ctx: &CompletionContext<'_>, - path_ctx: &PathCompletionCtx<'_>, + ctx: &CompletionContext<'_, 'db>, + path_ctx: &PathCompletionCtx<'db>, ) -> Option<()> { if !ctx.config.enable_imports_on_the_fly { return None; @@ -155,7 +155,7 @@ pub(crate) fn import_on_the_fly_path( pub(crate) fn import_on_the_fly_pat( acc: &mut Completions, - ctx: &CompletionContext<'_>, + ctx: &CompletionContext<'_, '_>, pattern_ctx: &PatternContext, ) -> Option<()> { if !ctx.config.enable_imports_on_the_fly { @@ -178,10 +178,10 @@ pub(crate) fn import_on_the_fly_pat( ) } -pub(crate) fn import_on_the_fly_dot( +pub(crate) fn import_on_the_fly_dot<'db>( acc: &mut Completions, - ctx: &CompletionContext<'_>, - dot_access: &DotAccess<'_>, + ctx: &CompletionContext<'_, 'db>, + dot_access: &DotAccess<'db>, ) -> Option<()> { if !ctx.config.enable_imports_on_the_fly { return None; @@ -206,11 +206,11 @@ pub(crate) fn import_on_the_fly_dot( ) } -fn import_on_the_fly( +fn import_on_the_fly<'db>( acc: &mut Completions, - ctx: &CompletionContext<'_>, - path_ctx @ PathCompletionCtx { kind, .. }: &PathCompletionCtx<'_>, - import_assets: ImportAssets<'_>, + ctx: &CompletionContext<'_, 'db>, + path_ctx @ PathCompletionCtx { kind, .. }: &PathCompletionCtx<'db>, + import_assets: ImportAssets<'db>, position: SyntaxNode, potential_import_name: String, ) -> Option<()> { @@ -292,11 +292,11 @@ fn import_on_the_fly( Some(()) } -fn import_on_the_fly_pat_( +fn import_on_the_fly_pat_<'db>( acc: &mut Completions, - ctx: &CompletionContext<'_>, + ctx: &CompletionContext<'_, 'db>, pattern_ctx: &PatternContext, - import_assets: ImportAssets<'_>, + import_assets: ImportAssets<'db>, position: SyntaxNode, potential_import_name: String, ) -> Option<()> { @@ -338,11 +338,11 @@ fn import_on_the_fly_pat_( Some(()) } -fn import_on_the_fly_method( +fn import_on_the_fly_method<'db>( acc: &mut Completions, - ctx: &CompletionContext<'_>, - dot_access: &DotAccess<'_>, - import_assets: ImportAssets<'_>, + ctx: &CompletionContext<'_, 'db>, + dot_access: &DotAccess<'db>, + import_assets: ImportAssets<'db>, position: SyntaxNode, potential_import_name: String, ) -> Option<()> { @@ -378,7 +378,7 @@ fn import_on_the_fly_method( Some(()) } -fn filter_excluded_flyimport(ctx: &CompletionContext<'_>, import: &LocatedImport) -> bool { +fn filter_excluded_flyimport(ctx: &CompletionContext<'_, '_>, import: &LocatedImport) -> bool { let def = import.item_to_import.into_module_def(); let is_exclude_flyimport = ctx.exclude_flyimport.get(&def).copied(); @@ -400,14 +400,14 @@ fn filter_excluded_flyimport(ctx: &CompletionContext<'_>, import: &LocatedImport true } -fn import_name(ctx: &CompletionContext<'_>) -> String { +fn import_name(ctx: &CompletionContext<'_, '_>) -> String { let token_kind = ctx.token.kind(); if token_kind.is_any_identifier() { ctx.token.to_string() } else { String::new() } } fn import_assets_for_path<'db>( - ctx: &CompletionContext<'db>, + ctx: &CompletionContext<'_, 'db>, path: Option<&ast::Path>, potential_import_name: &str, qualifier: Option<ast::Path>, |