Skip to content

bug: Can't complete nest use. can't jump to definition #5958

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
SolaWing opened this issue Sep 7, 2020 · 3 comments
Closed

bug: Can't complete nest use. can't jump to definition #5958

SolaWing opened this issue Sep 7, 2020 · 3 comments

Comments

@SolaWing
Copy link

SolaWing commented Sep 7, 2020

given the follow in file other.rs

//! other
#[derive(Default, Copy, Clone, Ord, PartialOrd, Eq, PartialEq)]
pub struct Foo {
}

pub trait Tr {
    fn bar(&self);
}

impl Foo {
    fn other() {
        println!("other");
    }
}

impl Tr for Foo {
    fn bar(&self) {
        Self::other();
    }
}

and main.rs

//! main.rs
mod other;
// use other::Tr; // if uncomment this, completion fine, but a.bar() can only jump to trait declaration, can't jump to definition.

/// hello
fn main() {
    use other::Tr;
    let a = other::Foo::default();
    a.bar();
    a.b // <-- no completion tip
}

trait is use nest in fn, compile fine but a.b not have completion tip.

if use other::Tr; at top, completion fine, but a.bar() can only jump to trait declaration, can't jump to Foo's definition.

@lnicola
Copy link
Member

lnicola commented Sep 7, 2020

Duplicate of #1165.

@lnicola lnicola closed this as completed Sep 7, 2020
@SolaWing
Copy link
Author

SolaWing commented Sep 7, 2020

@lnicola local import is same as #1165.

another problem, only jump to trait declaration, not Foo's definition, has any solution or relavant issuse?

@lnicola
Copy link
Member

lnicola commented Sep 7, 2020

Go to implementation is #4558.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants