-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Rust: pick correct edition for the files #19291
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
Conversation
Previously we would unconditionally set the edition to the latest stable according to rust-analyzer (2021 at the moment). Now we ask rust-analyzer itself to pick the correct edition for the file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors the file text retrieval and edition resolution logic in the Rust analyzer integration, allowing rust-analyzer to pick the correct edition for a file rather than using a hardcoded edition.
- Removed the explicit aliasing of EditionedFileId from ra_ap_span.
- Refactored parse() by extracting file data retrieval and edition resolution into a new get_file_data() method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DCA seems fine to me. Rust-analyzer comparison, call graph (same), per source went up, so QL and rust_analyzer are now more often in agreement.
Many of the "bad" result probably stem from RA doing better, and hence QL looking worse in comparison. Some numbers are worse (path resolution inconsistencies), but only few project and the relative change is very small. Might just be because we extract more/better stuff.
The merge-base changed after approval.
The merge-base changed after approval.
The merge-base changed after approval.
Previously we would unconditionally set the edition to the latest stable according to rust-analyzer (2021 at the moment). Now we ask rust-analyzer itself to pick the correct edition for the file.
In order to add integration tests this includes #19293, which therefore should possibly be merged before this.