rust-lang / rust-analyzer

A Rust compiler front-end for IDEs
https://rust-analyzer.github.io/
Apache License 2.0
13.62k stars 1.49k forks source link

Duplicate insertion of struct's field completion #17179

Closed bzy-debug closed 1 week ago

bzy-debug commented 2 weeks ago

rust-analyzer version: rust-analyzer version: 0.3.1940-standalone (f216be4a0 2024-04-27)

rustc version: rustc 1.77.2 (25ef9e3d8 2024-04-09)

editor or extension: vscode v0.3.1940

relevant settings: none

repository link (if public, optional): none

code snippet to reproduce:

struct S(i32);
fn main() {
    let s = S(1);
    s.0 // choose 0 in completion
}

choosing completion of 0 gets 0 inserted again:

https://github.com/rust-lang/rust-analyzer/assets/71200607/20301f17-c563-48c7-8bb4-b5faa38b0a98

expect behavior: nothing is inserted

roife commented 1 week ago

@rustbot claim