Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide-completion/src/context.rs')
-rw-r--r--crates/ide-completion/src/context.rs20
1 files changed, 10 insertions, 10 deletions
diff --git a/crates/ide-completion/src/context.rs b/crates/ide-completion/src/context.rs
index b9520e9132..f7fced3f06 100644
--- a/crates/ide-completion/src/context.rs
+++ b/crates/ide-completion/src/context.rs
@@ -458,10 +458,10 @@ pub(crate) enum ParamKind {
/// `CompletionContext` is created early during completion to figure out, where
/// exactly is the cursor, syntax-wise.
#[derive(Debug)]
-pub(crate) struct CompletionContext<'a> {
- pub(crate) sema: Semantics<'a, RootDatabase>,
- pub(crate) scope: SemanticsScope<'a>,
- pub(crate) db: &'a RootDatabase,
+pub(crate) struct CompletionContext<'a, 'db> {
+ pub(crate) sema: Semantics<'db, RootDatabase>,
+ pub(crate) scope: SemanticsScope<'db>,
+ pub(crate) db: &'db RootDatabase,
pub(crate) config: &'a CompletionConfig<'a>,
pub(crate) position: FilePosition,
@@ -487,7 +487,7 @@ pub(crate) struct CompletionContext<'a> {
/// This is usually the parameter name of the function argument we are completing.
pub(crate) expected_name: Option<NameOrNameRef>,
/// The expected type of what we are completing.
- pub(crate) expected_type: Option<Type<'a>>,
+ pub(crate) expected_type: Option<Type<'db>>,
pub(crate) qualifier_ctx: QualifierCtx,
@@ -523,7 +523,7 @@ pub(crate) enum CompleteSemicolon {
CompleteComma,
}
-impl CompletionContext<'_> {
+impl<'db> CompletionContext<'_, 'db> {
/// The range of the identifier that is being completed.
pub(crate) fn source_range(&self) -> TextRange {
let kind = self.original_token.kind();
@@ -540,7 +540,7 @@ impl CompletionContext<'_> {
}
}
- pub(crate) fn famous_defs(&self) -> FamousDefs<'_, '_> {
+ pub(crate) fn famous_defs(&self) -> FamousDefs<'_, 'db> {
FamousDefs(&self.sema, self.krate)
}
@@ -732,13 +732,13 @@ impl CompletionContext<'_> {
}
// CompletionContext construction
-impl<'db> CompletionContext<'db> {
+impl<'a, 'db> CompletionContext<'a, 'db> {
pub(crate) fn new(
db: &'db RootDatabase,
position @ FilePosition { file_id, offset }: FilePosition,
- config: &'db CompletionConfig<'db>,
+ config: &'a CompletionConfig<'a>,
trigger_character: Option<char>,
- ) -> Option<(CompletionContext<'db>, CompletionAnalysis<'db>)> {
+ ) -> Option<(CompletionContext<'a, 'db>, CompletionAnalysis<'db>)> {
let _p = tracing::info_span!("CompletionContext::new").entered();
let sema = Semantics::new(db);