9676: minor: Describe the current lifetime/label completion specifics r=Veykril a=Veykril

bors r+

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
This commit is contained in:
bors[bot] 2021-07-22 18:19:11 +00:00 committed by GitHub
commit b744e3369d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 10 additions and 3 deletions

View file

@ -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};

View file

@ -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 {}

View file

@ -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 {