Fix term_search filtering enum variant generics incorrectly

This commit is contained in:
Lukas Wirth 2024-06-24 09:28:03 +02:00
parent 8df034d453
commit db056b4a69
2 changed files with 5 additions and 5 deletions

View file

@ -144,7 +144,7 @@ fn f() { let a = A { x: 1, y: true }; let b: i32 = a.x; }"#,
term_search,
r#"//- minicore: todo, unimplemented, option
fn f() { let a: i32 = 1; let b: Option<i32> = todo$0!(); }"#,
r#"fn f() { let a: i32 = 1; let b: Option<i32> = Some(a); }"#,
r#"fn f() { let a: i32 = 1; let b: Option<i32> = Some::<i32>(a); }"#,
)
}
@ -156,7 +156,7 @@ fn f() { let a: i32 = 1; let b: Option<i32> = todo$0!(); }"#,
enum Option<T> { None, Some(T) }
fn f() { let a: i32 = 1; let b: Option<i32> = todo$0!(); }"#,
r#"enum Option<T> { None, Some(T) }
fn f() { let a: i32 = 1; let b: Option<i32> = Option::Some(a); }"#,
fn f() { let a: i32 = 1; let b: Option<i32> = Option::Some::<i32>(a); }"#,
)
}
@ -168,7 +168,7 @@ fn f() { let a: i32 = 1; let b: Option<i32> = Option::Some(a); }"#,
enum Option<T> { None, Some(T) }
fn f() { let a: Option<i32> = Option::None; let b: Option<Option<i32>> = todo$0!(); }"#,
r#"enum Option<T> { None, Some(T) }
fn f() { let a: Option<i32> = Option::None; let b: Option<Option<i32>> = Option::Some(a); }"#,
fn f() { let a: Option<i32> = Option::None; let b: Option<Option<i32>> = Option::Some::<Option<i32>>(a); }"#,
)
}
@ -180,7 +180,7 @@ fn f() { let a: Option<i32> = Option::None; let b: Option<Option<i32>> = Option:
enum Foo<T = i32> { Foo(T) }
fn f() { let a = 0; let b: Foo = todo$0!(); }"#,
r#"enum Foo<T = i32> { Foo(T) }
fn f() { let a = 0; let b: Foo = Foo::Foo(a); }"#,
fn f() { let a = 0; let b: Foo = Foo::Foo::<i32>(a); }"#,
);
check_assist(

View file

@ -2641,7 +2641,7 @@ fn foo() {
expect![[r#"
lc foo [type+local]
ex foo [type]
ex Foo::B [type]
ex Foo::B::<u32> [type]
ev Foo::A() [type_could_unify]
ev Foo::B [type_could_unify]
en Foo [type_could_unify]