Skip to content

Always error when failed to parse DiscoverProjectMessage #19684

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 25, 2025

Conversation

darichey
Copy link
Contributor

Currently we silently fail if the line can be parsed as json but not as DiscoverProjectData. That means if the discover command emits a malformed DiscoverProjectData, project discovery will never finish, and rust-analyzer becomes unusable. Instead, return an error if the line isn't a valid DiscoverProjectData so the discovery process fails and the error is correctly reported.

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 25, 2025
Copy link
Contributor

@davidbarsky davidbarsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approved, but will let someone else merge.

@Veykril Veykril added this pull request to the merge queue Apr 25, 2025
Merged via the queue into rust-lang:master with commit bfcef25 Apr 25, 2025
14 checks passed
facebook-github-bot pushed a commit to facebook/buck2 that referenced this pull request Apr 25, 2025
Summary: Currently if rust-project emits a malformed `DiscoverProjectData`, rust-analyzer will silently ignore it. I want to change this in rust-lang/rust-analyzer#19684, but we need to first ensure that rust-project only emits these events and not other logs. Currently, all tracing events are emitted by the `ProgressLayer`. This diff makes it so only events with an explicit `kind` are emitted.

Reviewed By: davidbarsky, dtolnay

Differential Revision: D73638698

fbshipit-source-id: 11cc8d95f250ab8fa3d315a2ac69ad01e2f7372d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants