From 08b822b25914bea7405a30383fe43c7235d14346 Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Wed, 20 Jan 2021 18:46:14 +0100 Subject: Update completions test output --- .../completion/src/completions/unqualified_path.rs | 36 ++++++------ crates/completion/src/item.rs | 2 +- crates/completion/src/render.rs | 64 ++++++++++++++++------ 3 files changed, 66 insertions(+), 36 deletions(-) diff --git a/crates/completion/src/completions/unqualified_path.rs b/crates/completion/src/completions/unqualified_path.rs index 860c774c1..a289efc34 100644 --- a/crates/completion/src/completions/unqualified_path.rs +++ b/crates/completion/src/completions/unqualified_path.rs @@ -165,8 +165,8 @@ fn quux(x: i32) { } "#, expect![[r#" - bn y i32 - bn x i32 + lc y i32 + lc x i32 fn quux(…) fn quux(x: i32) "#]], ); @@ -187,8 +187,8 @@ fn quux() { } "#, expect![[r#" - bn b i32 - bn a + lc b i32 + lc a fn quux() fn quux() "#]], ); @@ -203,7 +203,7 @@ fn quux() { } "#, expect![[r#" - bn x + lc x fn quux() fn quux() "#]], ); @@ -263,7 +263,7 @@ fn main() { check( r#"struct S { x: $0}"#, expect![[r#" - tp Self + sp Self tp T st S<…> "#]], @@ -275,7 +275,7 @@ fn main() { check( r#"enum X { Y($0) }"#, expect![[r#" - tp Self + sp Self en X "#]], ); @@ -378,8 +378,8 @@ fn foo() { "#, // FIXME: should be only one bar here expect![[r#" - bn bar i32 - bn bar i32 + lc bar i32 + lc bar i32 fn foo() fn foo() "#]], ); @@ -390,8 +390,8 @@ fn foo() { check( r#"impl S { fn foo(&self) { $0 } }"#, expect![[r#" - bn self &{unknown} - tp Self + lc self &{unknown} + sp Self "#]], ); } @@ -575,8 +575,8 @@ fn quux(x: i32) { } "#, expect![[r#" - bn y i32 - bn x i32 + lc y i32 + lc x i32 fn quux(…) fn quux(x: i32) ma m!(…) macro_rules! m "#]], @@ -594,8 +594,8 @@ fn quux(x: i32) { } ", expect![[r#" - bn y i32 - bn x i32 + lc y i32 + lc x i32 fn quux(…) fn quux(x: i32) ma m!(…) macro_rules! m "#]], @@ -613,8 +613,8 @@ fn quux(x: i32) { } "#, expect![[r#" - bn y i32 - bn x i32 + lc y i32 + lc x i32 fn quux(…) fn quux(x: i32) ma m!(…) macro_rules! m "#]], @@ -750,7 +750,7 @@ struct MyStruct {} impl My$0 "#, expect![[r#" - tp Self + sp Self tt MyTrait st MyStruct "#]], diff --git a/crates/completion/src/item.rs b/crates/completion/src/item.rs index 178e05c46..d2e6a6aeb 100644 --- a/crates/completion/src/item.rs +++ b/crates/completion/src/item.rs @@ -121,9 +121,9 @@ pub enum CompletionScore { #[derive(Debug, Clone, Copy, PartialEq, Eq)] pub enum CompletionItemKind { SymbolKind(SymbolKind), - BuiltinType, Attribute, Binding, + BuiltinType, Keyword, Method, Snippet, diff --git a/crates/completion/src/render.rs b/crates/completion/src/render.rs index 8f66f6e59..fa594b5e5 100644 --- a/crates/completion/src/render.rs +++ b/crates/completion/src/render.rs @@ -409,7 +409,9 @@ fn main() { Foo::Fo$0 } source_range: 54..56, delete: 54..56, insert: "Foo", - kind: EnumVariant, + kind: SymbolKind( + Variant, + ), detail: "{ x: i32, y: i32 }", }, ] @@ -432,7 +434,9 @@ fn main() { Foo::Fo$0 } source_range: 46..48, delete: 46..48, insert: "Foo($0)", - kind: EnumVariant, + kind: SymbolKind( + Variant, + ), lookup: "Foo", detail: "(i32, i32)", trigger_call_info: true, @@ -457,7 +461,9 @@ fn main() { Foo::Fo$0 } source_range: 35..37, delete: 35..37, insert: "Foo", - kind: EnumVariant, + kind: SymbolKind( + Variant, + ), detail: "()", }, ] @@ -481,7 +487,9 @@ fn main() { let _: m::Spam = S$0 } source_range: 75..76, delete: 75..76, insert: "Spam::Bar($0)", - kind: EnumVariant, + kind: SymbolKind( + Variant, + ), lookup: "Spam::Bar", detail: "(i32)", trigger_call_info: true, @@ -491,14 +499,18 @@ fn main() { let _: m::Spam = S$0 } source_range: 75..76, delete: 75..76, insert: "m", - kind: Module, + kind: SymbolKind( + Module, + ), }, CompletionItem { label: "m::Spam::Foo", source_range: 75..76, delete: 75..76, insert: "m::Spam::Foo", - kind: EnumVariant, + kind: SymbolKind( + Variant, + ), lookup: "Spam::Foo", detail: "()", }, @@ -507,7 +519,9 @@ fn main() { let _: m::Spam = S$0 } source_range: 75..76, delete: 75..76, insert: "main()$0", - kind: Function, + kind: SymbolKind( + Function, + ), lookup: "main", detail: "fn main()", }, @@ -534,7 +548,9 @@ fn main() { som$0 } source_range: 127..130, delete: 127..130, insert: "main()$0", - kind: Function, + kind: SymbolKind( + Function, + ), lookup: "main", detail: "fn main()", }, @@ -543,7 +559,9 @@ fn main() { som$0 } source_range: 127..130, delete: 127..130, insert: "something_deprecated()$0", - kind: Function, + kind: SymbolKind( + Function, + ), lookup: "something_deprecated", detail: "fn something_deprecated()", deprecated: true, @@ -553,7 +571,9 @@ fn main() { som$0 } source_range: 127..130, delete: 127..130, insert: "something_else_deprecated()$0", - kind: Function, + kind: SymbolKind( + Function, + ), lookup: "something_else_deprecated", detail: "fn something_else_deprecated()", deprecated: true, @@ -574,7 +594,9 @@ fn foo() { A { the$0 } } source_range: 57..60, delete: 57..60, insert: "the_field", - kind: Field, + kind: SymbolKind( + Field, + ), detail: "u32", deprecated: true, }, @@ -614,7 +636,9 @@ impl S { source_range: 94..94, delete: 94..94, insert: "foo", - kind: Field, + kind: SymbolKind( + Field, + ), detail: "{unknown}", documentation: Documentation( "Field docs", @@ -645,7 +669,9 @@ use self::E::*; source_range: 10..12, delete: 10..12, insert: "E", - kind: Enum, + kind: SymbolKind( + Enum, + ), documentation: Documentation( "enum docs", ), @@ -655,7 +681,9 @@ use self::E::*; source_range: 10..12, delete: 10..12, insert: "V", - kind: EnumVariant, + kind: SymbolKind( + Variant, + ), detail: "()", documentation: Documentation( "variant docs", @@ -666,7 +694,9 @@ use self::E::*; source_range: 10..12, delete: 10..12, insert: "my", - kind: Module, + kind: SymbolKind( + Module, + ), documentation: Documentation( "mod docs", ), @@ -892,7 +922,7 @@ struct WorldSnapshot { _f: () }; fn go(world: &WorldSnapshot) { go(w$0) } "#, expect![[r#" - bn world [type+name] + lc world [type+name] st WorldSnapshot [] fn go(…) [] "#]], @@ -909,7 +939,7 @@ fn f(foo: &Foo) { f(foo, w$0) } expect![[r#" st Foo [] fn f(…) [] - bn foo [] + lc foo [] "#]], ); } -- cgit v1.2.3