Skip to content

Possible synchronisation issue causes nonsense syntax errors #6402

Closed
@Timmmm

Description

@Timmmm

I unfortunately don't have a way to reproduce this, but within the last couple of weeks I have noticed a new issue - sometimes when I make edits and save the file to trigger cargo check it gives me nonsensical syntax errors. This didn't used to happen. Editing a bit more and saving the file does not help. Reloading the window does.

It feels a lot like Rust-analyzer's internal representation of the code is getting out of sync with VSCode's representation. I have written a couple of language servers and I know the incremental text changing bit is hard to get right - maybe an obscure bug there.

Is there any way to get rust-analyzer to dump what it thinks the current state of a file is?

Metadata

Metadata

Assignees

No one assigned

    Labels

    S-unactionableIssue requires feedback, design decisions or is blocked on other work

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions