Skip to content

Commit

Permalink
Auto merge of rust-lang#12160 - Veykril:completions-rev, r=Veykril
Browse files Browse the repository at this point in the history
minor: Sort ide-completions test outputs for less disruptive diffs
  • Loading branch information
bors committed May 5, 2022
2 parents 01198da + 5280e08 commit 52a58f6
Show file tree
Hide file tree
Showing 21 changed files with 946 additions and 945 deletions.
8 changes: 4 additions & 4 deletions crates/ide-completion/src/completions/dot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,9 @@ pub mod m {
fn foo(a: lib::m::A) { a.$0 }
"#,
expect![[r#"
fd crate_field u32
fd private_field u32
fd pub_field u32
fd crate_field u32
fd super_field u32
"#]],
);
Expand Down Expand Up @@ -248,8 +248,8 @@ mod m {
fn foo(a: lib::A) { a.$0 }
"#,
expect![[r#"
me private_method() fn(&self)
me crate_method() fn(&self)
me private_method() fn(&self)
me pub_method() fn(&self)
"#]],
);
Expand Down Expand Up @@ -686,11 +686,11 @@ struct Foo { field: i32 }
impl Foo { fn foo(&self) { $0 } }"#,
expect![[r#"
fd self.field i32
me self.foo() fn(&self)
lc self &Foo
sp Self
st Foo
bt u32
me self.foo() fn(&self)
"#]],
);
check(
Expand All @@ -700,11 +700,11 @@ struct Foo(i32);
impl Foo { fn foo(&mut self) { $0 } }"#,
expect![[r#"
fd self.0 i32
me self.foo() fn(&mut self)
lc self &mut Foo
sp Self
st Foo
bt u32
me self.foo() fn(&mut self)
"#]],
);
}
Expand Down
18 changes: 9 additions & 9 deletions crates/ide-completion/src/completions/keyword.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,8 @@ mod tests {
r"fn my_fn() { unsafe $0 }",
expect![[r#"
kw fn
kw trait
kw impl
kw trait
sn pd
sn ppd
"#]],
Expand All @@ -225,15 +225,15 @@ fn foo(a: A) { a.$0 }
"#,
expect![[r#"
kw await expr.await
sn ref &expr
sn refm &mut expr
sn match match expr {}
sn box Box::new(expr)
sn call function(expr)
sn dbg dbg!(expr)
sn dbgr dbg!(&expr)
sn call function(expr)
sn let let
sn letm let mut
sn match match expr {}
sn ref &expr
sn refm &mut expr
"#]],
);

Expand All @@ -248,15 +248,15 @@ fn foo() {
"#,
expect![[r#"
kw await expr.await
sn ref &expr
sn refm &mut expr
sn match match expr {}
sn box Box::new(expr)
sn call function(expr)
sn dbg dbg!(expr)
sn dbgr dbg!(&expr)
sn call function(expr)
sn let let
sn letm let mut
sn match match expr {}
sn ref &expr
sn refm &mut expr
"#]],
)
}
Expand Down
6 changes: 3 additions & 3 deletions crates/ide-completion/src/completions/mod_.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,8 @@ fn bar() {}
fn ignored_bar() {}
"#,
expect![[r#"
md foo;
md bar;
md foo;
"#]],
);
}
Expand Down Expand Up @@ -219,8 +219,8 @@ fn bar() {}
fn ignored_bar() {}
"#,
expect![[r#"
md foo;
md bar;
md foo;
"#]],
);
}
Expand Down Expand Up @@ -346,8 +346,8 @@ fn bar() {}
fn ignored_bar() {}
"#,
expect![[r#"
md foo;
md bar;
md foo;
"#]],
);
}
Expand Down
48 changes: 24 additions & 24 deletions crates/ide-completion/src/completions/postfix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -309,18 +309,18 @@ fn main() {
}
"#,
expect![[r#"
sn if if expr {}
sn while while expr {}
sn not !expr
sn ref &expr
sn refm &mut expr
sn match match expr {}
sn box Box::new(expr)
sn call function(expr)
sn dbg dbg!(expr)
sn dbgr dbg!(&expr)
sn call function(expr)
sn if if expr {}
sn let let
sn letm let mut
sn match match expr {}
sn not !expr
sn ref &expr
sn refm &mut expr
sn while while expr {}
"#]],
);
}
Expand All @@ -339,16 +339,16 @@ fn main() {
}
"#,
expect![[r#"
sn box Box::new(expr)
sn call function(expr)
sn dbg dbg!(expr)
sn dbgr dbg!(&expr)
sn if if expr {}
sn while while expr {}
sn match match expr {}
sn not !expr
sn ref &expr
sn refm &mut expr
sn match match expr {}
sn box Box::new(expr)
sn dbg dbg!(expr)
sn dbgr dbg!(&expr)
sn call function(expr)
sn while while expr {}
"#]],
);
}
Expand All @@ -363,15 +363,15 @@ fn main() {
}
"#,
expect![[r#"
sn ref &expr
sn refm &mut expr
sn match match expr {}
sn box Box::new(expr)
sn call function(expr)
sn dbg dbg!(expr)
sn dbgr dbg!(&expr)
sn call function(expr)
sn let let
sn letm let mut
sn match match expr {}
sn ref &expr
sn refm &mut expr
"#]],
)
}
Expand All @@ -386,18 +386,18 @@ fn main() {
}
"#,
expect![[r#"
sn if if expr {}
sn while while expr {}
sn not !expr
sn ref &expr
sn refm &mut expr
sn match match expr {}
sn box Box::new(expr)
sn call function(expr)
sn dbg dbg!(expr)
sn dbgr dbg!(&expr)
sn call function(expr)
sn if if expr {}
sn let let
sn letm let mut
sn match match expr {}
sn not !expr
sn ref &expr
sn refm &mut expr
sn while while expr {}
"#]],
);
}
Expand Down
24 changes: 12 additions & 12 deletions crates/ide-completion/src/completions/qualified_path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,8 @@ impl S {
fn foo() { let _ = lib::S::$0 }
"#,
expect![[r#"
fn public_method() fn()
ct PUBLIC_CONST pub const PUBLIC_CONST: u32
fn public_method() fn()
ta PublicType pub type PublicType = u32
"#]],
);
Expand Down Expand Up @@ -340,14 +340,14 @@ trait Sub: Super {
fn foo<T: Sub>() { T::$0 }
"#,
expect![[r#"
ta SubTy (as Sub) type SubTy
ta Ty (as Super) type Ty
ct C2 (as Sub) const C2: ()
fn subfunc() (as Sub) fn()
me submethod(…) (as Sub) fn(&self)
ct CONST (as Super) const CONST: u8
fn func() (as Super) fn()
fn subfunc() (as Sub) fn()
ta SubTy (as Sub) type SubTy
ta Ty (as Super) type Ty
me method(…) (as Super) fn(&self)
me submethod(…) (as Sub) fn(&self)
"#]],
);
}
Expand Down Expand Up @@ -380,13 +380,13 @@ impl<T> Sub for Wrap<T> {
}
"#,
expect![[r#"
ta SubTy (as Sub) type SubTy
ta Ty (as Super) type Ty
ct C2 (as Sub) const C2: ()
ct CONST (as Super) const CONST: u8
fn func() (as Super) fn()
me method(…) (as Super) fn(&self)
ct C2 (as Sub) const C2: ()
fn subfunc() (as Sub) fn()
ta SubTy (as Sub) type SubTy
ta Ty (as Super) type Ty
me method(…) (as Super) fn(&self)
me submethod(…) (as Sub) fn(&self)
"#]],
);
Expand All @@ -404,8 +404,8 @@ impl T { fn bar() {} }
fn main() { T::$0; }
"#,
expect![[r#"
fn foo() fn()
fn bar() fn()
fn foo() fn()
"#]],
);
}
Expand Down Expand Up @@ -518,8 +518,8 @@ fn main() { m!(self::f$0); }
fn foo() {}
"#,
expect![[r#"
fn main() fn()
fn foo() fn()
fn main() fn()
"#]],
);
}
Expand All @@ -536,8 +536,8 @@ mod m {
}
"#,
expect![[r#"
md z
fn z() fn()
md z
"#]],
);
}
Expand Down
12 changes: 6 additions & 6 deletions crates/ide-completion/src/completions/trait_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -343,8 +343,8 @@ impl Test for T {
",
expect![[r#"
sp Self
tt Test
st T
tt Test
bt u32
"#]],
);
Expand Down Expand Up @@ -448,8 +448,8 @@ impl Test for T {
",
expect![[r#"
sp Self
tt Test
st T
tt Test
bt u32
"#]],
);
Expand All @@ -465,8 +465,8 @@ impl Test for T {
",
expect![[r#"
sp Self
tt Test
st T
tt Test
bt u32
"#]],
);
Expand All @@ -484,8 +484,8 @@ impl Test for T {
",
expect![[r#"
sp Self
tt Test
st T
tt Test
bt u32
"#]],
);
Expand Down Expand Up @@ -532,8 +532,8 @@ impl Test for T {
",
expect![[r#"
sp Self
tt Test
st T
tt Test
bt u32
"#]],
);
Expand All @@ -549,8 +549,8 @@ impl Test for T {
",
expect![[r#"
sp Self
tt Test
st T
tt Test
bt u32
"#]],
);
Expand Down
6 changes: 3 additions & 3 deletions crates/ide-completion/src/completions/unqualified_path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,8 @@ pub mod prelude {
"#,
expect![[r#"
md std
bt u32
st Option
bt u32
"#]],
);
}
Expand Down Expand Up @@ -233,10 +233,10 @@ pub mod prelude {
}
"#,
expect![[r#"
md std
md core
bt u32
md std
st String
bt u32
"#]],
);
}
Expand Down
2 changes: 1 addition & 1 deletion crates/ide-completion/src/item.rs
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ impl CompletionRelevance {
}

/// The type of the completion item.
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord)]
pub enum CompletionItemKind {
SymbolKind(SymbolKind),
Binding,
Expand Down
1 change: 1 addition & 0 deletions crates/ide-completion/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ fn completion_list_with_config(
})
.filter(|it| include_keywords || it.kind() != CompletionItemKind::Keyword)
.filter(|it| include_keywords || it.kind() != CompletionItemKind::Snippet)
.sorted_by_key(|it| (it.kind(), it.label().to_owned(), it.detail().map(ToOwned::to_owned)))
.collect();
render_completion_list(items)
}
Expand Down
Loading

0 comments on commit 52a58f6

Please sign in to comment.