mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 12:29:21 +00:00
fix: Goto implementation to impls inside blocks
This commit is contained in:
parent
b91697de8f
commit
967a864d03
2 changed files with 97 additions and 1 deletions
|
@ -337,6 +337,77 @@ impl Tr for S {
|
|||
const C: usize = 4;
|
||||
//^
|
||||
}
|
||||
"#,
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn goto_adt_implementation_inside_block() {
|
||||
check(
|
||||
r#"
|
||||
//- minicore: copy, derive
|
||||
trait Bar {}
|
||||
|
||||
fn test() {
|
||||
#[derive(Copy)]
|
||||
//^^^^^^^^^^^^^^^
|
||||
struct Foo$0;
|
||||
|
||||
impl Foo {}
|
||||
//^^^
|
||||
|
||||
trait Baz {}
|
||||
|
||||
impl Bar for Foo {}
|
||||
//^^^
|
||||
|
||||
impl Baz for Foo {}
|
||||
//^^^
|
||||
}
|
||||
"#,
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn goto_trait_implementation_inside_block() {
|
||||
check(
|
||||
r#"
|
||||
struct Bar;
|
||||
|
||||
fn test() {
|
||||
trait Foo$0 {}
|
||||
|
||||
struct Baz;
|
||||
|
||||
impl Foo for Bar {}
|
||||
//^^^
|
||||
|
||||
impl Foo for Baz {}
|
||||
//^^^
|
||||
}
|
||||
"#,
|
||||
);
|
||||
check(
|
||||
r#"
|
||||
struct Bar;
|
||||
|
||||
fn test() {
|
||||
trait Foo {
|
||||
fn foo$0() {}
|
||||
}
|
||||
|
||||
struct Baz;
|
||||
|
||||
impl Foo for Bar {
|
||||
fn foo() {}
|
||||
//^^^
|
||||
}
|
||||
|
||||
impl Foo for Baz {
|
||||
fn foo() {}
|
||||
//^^^
|
||||
}
|
||||
}
|
||||
"#,
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue