Skip to content
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

Public re-exports do not appear in code completion #17042

Closed
Tracked by #14079
misaka10987 opened this issue Apr 10, 2024 · 4 comments · Fixed by #18382
Closed
Tracked by #14079

Public re-exports do not appear in code completion #17042

misaka10987 opened this issue Apr 10, 2024 · 4 comments · Fixed by #18382
Assignees
Labels
A-completion autocompletion C-bug Category: bug

Comments

@misaka10987
Copy link

misaka10987 commented Apr 10, 2024

rust-analyzer version: v0.3.1916

rustc version: 1.76.0

editor or extension: VSCodium

relevant settings: None

code snippet to reproduce:

crate-a/lib.rs

pub fn add(a:i32,b:i32)->i32{
    a+b
}

crate-b/lib.rs

pub use crate_a::add as my_add;

crate-b/some.rs

fn xxx(){
    // type my_add here and there is no completion or auto-import.
}
@misaka10987 misaka10987 added the C-bug Category: bug label Apr 10, 2024
@lnicola lnicola added the A-completion autocompletion label Apr 10, 2024
@misaka10987
Copy link
Author

Also, there is a notice says "consider importing this function through its public re-export: use crate::my_add;" in the "Quick fix" option, but it will suggest you import crate_a::add instead of crate::my_add when clicked.

@lnicola
Copy link
Member

lnicola commented Apr 10, 2024

That's a rustc message, does cargo check actually work?

@misaka10987
Copy link
Author

That's a rustc message, does cargo check actually work?

Yes an error[E0425]: cannot find function my_add in this scope is produced as expected

@dqkqd
Copy link
Contributor

dqkqd commented Oct 23, 2024

@rustbot claim

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-completion autocompletion C-bug Category: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants