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

Rust auto-import selecting the incorrect entry #20148

Closed
1 task done
road2react opened this issue Nov 4, 2024 · 6 comments
Closed
1 task done

Rust auto-import selecting the incorrect entry #20148

road2react opened this issue Nov 4, 2024 · 6 comments
Labels
bug [core label] can't reproduce Issue that can't be reproduced (transient, invalid, etc) language server An umbrella label for all language servers language An umbrella label for all programming languages syntax behaviors rust Rust programming language support

Comments

@road2react
Copy link

Check for existing issues

  • Completed

Describe the bug / provide steps to reproduce it

When there are multiple similar items, it always imports the first one, even if the other ones are selected.

Example:

fn main() {
    let x = Weak
}

When auto-importing Weak, selecting std::sync::Weak imports std::rc::Weak instead.

image

image

Environment

Zed: v0.159.5 (Zed)
OS: Linux Wayland arch unknown
Memory: 93.5 GiB
Architecture: x86_64
GPU: AMD Radeon 680M (RADV REMBRANDT) || radv || Mesa 24.2.6-arch1.1

If applicable, add mockups / screenshots to help explain present your vision of the feature

No response

If applicable, attach your Zed.log file to this issue.

No response

@road2react road2react added admin read bug [core label] labels Nov 4, 2024
@osiewicz
Copy link
Contributor

osiewicz commented Nov 4, 2024

I cannot reproduce this on latest nightly.

@dovakin0007
Copy link
Contributor

dovakin0007 commented Nov 4, 2024

I cannot reproduce this on latest nightly.

then it's fixed?

@Sliman4
Copy link

Sliman4 commented Nov 5, 2024

Haven't tried on nightly, but 0.159.9 doesn't import the first one (even though I want the first one)
Screencast_20241105_191957.webm

@aalhitennf
Copy link

Having same problem with zed 0.160.7.

zed

Description on right is showing documentation for env_logger::fmt::style::Style, which it also imports if selected.

@JosephTLyons JosephTLyons added rust Rust programming language support language An umbrella label for all programming languages syntax behaviors language server An umbrella label for all language servers can't reproduce Issue that can't be reproduced (transient, invalid, etc) and removed triage labels Nov 10, 2024
@SomeoneToIgnore
Copy link
Contributor

This will be fixed

@SomeoneToIgnore
Copy link
Contributor

rust-lang/rust-analyzer#18503 should have been released today with rust-analyzer, so closing this.

Please comment here if things are not working still and you're sure you're using the rust-analyzer-2024-11-18 or later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug [core label] can't reproduce Issue that can't be reproduced (transient, invalid, etc) language server An umbrella label for all language servers language An umbrella label for all programming languages syntax behaviors rust Rust programming language support
Projects
None yet
Development

No branches or pull requests

7 participants