Skip to content

Commit b744e33

Browse files
bors[bot]Veykril
andauthored
Merge #9676
9676: minor: Describe the current lifetime/label completion specifics r=Veykril a=Veykril bors r+ Co-authored-by: Lukas Wirth <[email protected]>
2 parents 096e369 + 1f558fa commit b744e33

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

crates/ide_completion/src/completions/lifetime.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
//! Completes lifetimes and labels.
2+
//!
3+
//! These completions work a bit differently in that they are only shown when what the user types
4+
//! has a `'` preceding it, as our fake syntax tree is invalid otherwise(due to us not inserting a
5+
//! lifetime but an ident for obvious reasons).
6+
//! Due to this all the tests for lifetimes and labels live in this module for the time being as
7+
//! there is no value in lifting these out into the outline module test since they will either not
8+
//! show up for normal completions, or they won't show completions other than lifetimes depending
9+
//! on the fixture input.
210
use hir::ScopeDef;
311

412
use crate::{completions::Completions, context::CompletionContext};

crates/ide_completion/src/tests/predicate.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ struct Foo<'lt, T, const C: usize> where $0 {}
3535

3636
#[test]
3737
fn bound_for_type_pred() {
38-
// FIXME: only show traits, macros and modules
3938
check(
4039
r#"
4140
struct Foo<'lt, T, const C: usize> where T: $0 {}
@@ -54,7 +53,8 @@ struct Foo<'lt, T, const C: usize> where T: $0 {}
5453

5554
#[test]
5655
fn bound_for_lifetime_pred() {
57-
// FIXME: should only show lifetimes here
56+
// FIXME: should only show lifetimes here, that is we shouldn't get any completions here when not typing
57+
// a `'`
5858
check(
5959
r#"
6060
struct Foo<'lt, T, const C: usize> where 'lt: $0 {}

crates/ide_completion/src/tests/type_pos.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,6 @@ fn foo<'lt, T, const C: usize>() {
142142

143143
#[test]
144144
fn completes_types_and_const_in_arg_list() {
145-
// FIXME: we should complete the lifetime here for now
146145
check_with(
147146
r#"
148147
trait Trait2 {

0 commit comments

Comments
 (0)