diff --git a/crates/ide_completion/src/completions/lifetime.rs b/crates/ide_completion/src/completions/lifetime.rs index abf6935c94..7b98814577 100644 --- a/crates/ide_completion/src/completions/lifetime.rs +++ b/crates/ide_completion/src/completions/lifetime.rs @@ -1,4 +1,12 @@ //! Completes lifetimes and labels. +//! +//! These completions work a bit differently in that they are only shown when what the user types +//! has a `'` preceding it, as our fake syntax tree is invalid otherwise(due to us not inserting a +//! lifetime but an ident for obvious reasons). +//! Due to this all the tests for lifetimes and labels live in this module for the time being as +//! 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 crate::{completions::Completions, context::CompletionContext}; diff --git a/crates/ide_completion/src/tests/predicate.rs b/crates/ide_completion/src/tests/predicate.rs index 0821e22f28..b65a716ed5 100644 --- a/crates/ide_completion/src/tests/predicate.rs +++ b/crates/ide_completion/src/tests/predicate.rs @@ -35,7 +35,6 @@ struct Foo<'lt, T, const C: usize> where $0 {} #[test] fn bound_for_type_pred() { - // FIXME: only show traits, macros and modules check( r#" struct Foo<'lt, T, const C: usize> where T: $0 {} @@ -54,7 +53,8 @@ struct Foo<'lt, T, const C: usize> where T: $0 {} #[test] fn bound_for_lifetime_pred() { - // FIXME: should only show lifetimes here + // FIXME: should only show lifetimes here, that is we shouldn't get any completions here when not typing + // a `'` check( r#" struct Foo<'lt, T, const C: usize> where 'lt: $0 {} diff --git a/crates/ide_completion/src/tests/type_pos.rs b/crates/ide_completion/src/tests/type_pos.rs index 844e209505..efffa4ee6e 100644 --- a/crates/ide_completion/src/tests/type_pos.rs +++ b/crates/ide_completion/src/tests/type_pos.rs @@ -142,7 +142,6 @@ fn foo<'lt, T, const C: usize>() { #[test] fn completes_types_and_const_in_arg_list() { - // FIXME: we should complete the lifetime here for now check_with( r#" trait Trait2 {