Skip to content

rust-analyzer reports code block errors while typing / mid-edit #20097

@kurtbuilds

Description

@kurtbuilds

Check for existing issues

  • Completed

Describe the bug / provide steps to reproduce it

Apologies if this is user / settings error.

When I'm editing Rust files, it seems like rust-analyzer runs "too frequently." As one example, if I'm writing a code block and halfway through writing a if statement, the whole code block starts reporting an error until I finish the statement.

Screenshot here:
image

This isn't meant to be the file state of the code, I'm in the middle of typing. And it's really distracting to have rust-analyzer throw the whole function as an error.

It's not exactly obvious what a better trigger is. On save? Maybe it just needs to filter some errors. I would want this error reported when the file is saved, but not while the file is dirty or I'm mid edit.

To add on to this, it also causes Zed to lose inline types and autocompletions from rust-analyzer. Note when I go back to valid syntax, inline types re-appear.

image

There should be some notion of persistence/resilience to the Rust-analyzer hints.

Environment

Zed: v0.159.7 (Zed)
OS: macOS 15.0.1
Memory: 64 GiB
Architecture: aarch64

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.

Zed.log

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:language serverAn umbrella label for all language serversarea:languagesAn umbrella label for all programming languages syntax behaviorsarea:languages/rustRust programming language supportbugDEPRECATED label: use issue type 'Bug' insteadstaleLabel used by `stale` action

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions