Skip to content

Buggy autocompletion for traits like std::ops::Add #16080

@joseph-amirth

Description

@joseph-amirth

rust-analyzer version: rust-analyzer version: 0.3.1756-standalone

rustc version: rustc 1.74.0 (79e9716c9 2023-11-13)

relevant settings:
I am using archlinux and I've installed the rust toolchain using the usual rustup default stable command. I haven't modified the rust installation in any way.

Expected Behavior
When "impl Add" is typed, "Add" should appear in the autocompletion list as it is an exact match.

Observed Behavior
Add is in the autocompletion list when I am still typing prefixes of Add ("A" and "Ad") but when I type the entire word "Add", Add mysteriously disappears from the autocompletion list.

The behavior is as expected for other traits like AddAssign (I get "AddAssign" in the autocompletion list even when I've typed the entire name out), but for traits like Add, Neg, Sub, Mul I get this buggy behavior where once the name is fully typed out, it disappears from the autocompletion list. The only pattern I've noticed is that these traits have 3 letters but I can't imagine such an arbitrary condition could cause this.

Minimal Reproducible Example:

  1. Install VSCode and install the "rust-analyzer" plugin.

  2. Create a new project and above the main function, type "impl Add" and observe that "Add" appears in the autocompletion list when only prefixes of Add ("A"/"Ad") have been typed, but "Add" disappears from the autocompletion list once the entire word is typed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions