-
Notifications
You must be signed in to change notification settings - Fork 1.8k
internal: move diagnostics to hir #8973
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
2594219
to
57b024d
Compare
The idea here is to eventually get rid of `dyn Diagnostic` and `DiagnosticSink` infrastructure altogether, and just have a `enum hir::Diagnostic` instead. The problem with `dyn Diagnostic` is that it is defined in the lowest level of the stack (hir_expand), but is used by the highest level (ide). As a first step, we free hir_expand and hir_def from `dyn Diagnostic` and kick the can up to `hir_ty`, as an intermediate state. The plan is then to move DiagnosticSink similarly to the hir crate, and, as final third step, remove its usage from the ide. One currently unsolved problem is testing. You can notice that the test which checks precise diagnostic ranges, unresolved_import_in_use_tree, was moved to the ide layer. Logically, only IDE should have the infra to render a specific range. At the same time, the range is determined with the data produced in hir_def and hir crates, so this layering is rather unfortunate. Working on hir_def shouldn't require compiling `ide` for testing.
r? @flodiebold, ready for review now. Does this match your vision for diagnostics=data? |
Hmm yes it goes in the direction, but I wouldn't have expected the diagnostics to just move to |
still can’t read, negation is hard. |
I thought I wrote that badly 😅 I'd have expected diagnostics infra to move to |
So what I think we want in the end is
In terms of diff with this PR, the type definitions in |
Agree, I think we probably don't need the traits. |
bors r+ |
No description provided.