Skip to content

Autocomplete not working when line is not terminated with semicolon in macro annotated method #20747

@DGolubets

Description

@DGolubets

rust-analyzer version: rust-analyzer 1.90.0 (1159e78 2025-09-14)

rustc version: rustc 1.90.0 (1159e78c4 2025-09-14)

editor or extension: Zed 0.205.5

code snippet to reproduce:

#[faux::create]
struct S {
    a: i32,
}

#[faux::methods]
impl S {
    fn do_work(&mut self) {
        let s = "abcd";
        //let n = s.len();
        self.a = 0;
    }
}

When typing the commented line, I don't get a suggestion for len method or any other methods.
If I put semicolon in the end in advance, then it starts working.
Also if I remove macros annotations then it starts working as expected too.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions