Refactor how diagnostics are pushed through incremental; add queries.AST#404
Merged
Refactor how diagnostics are pushed through incremental; add queries.AST#404
incremental; add queries.AST#404Conversation
Member
|
Mind fixing the CI test failures? I often don't start a review when CI is red because I think you might still be actively working on the branch. |
jhump
approved these changes
Jan 7, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
NonFatalfunctionality of the incremental package has proven to be a poor abstraction. What I essentially wanted was a way to have queries generate diagnostics, which I could then deduplicate and collect in the end.Collecting diagnostics from dependencies is incorrect, because A -> B, A -> C, B -> D, C -> D would mean diagnostics for D contain the diagnostics from A twice. The rough idea was to instead stash reports in the
NonFatalarea, which required the somewhat unnatural-feelingreport.AsErrortype. But this is unnecessary ceremony: all thatNonFatalwill ever be used for is for stashing reports, so the incremental framework should Just Do That. It's not a general library, after all.This PR replaces
Task.NonFatalwithTask.Report, which is a report included with each task. WhenRuncompletes, it collects the set of all queries that were computed (possibly from cache) and merges their reports, and sorts it to eliminate non-determinism.It is not immediately clear to me if having tasks return
(v T, fatal error)is still useful. Perhaps(v T, ok bool)may be more appropriate, since that error should be logged as a diagnostic and will probably just get thrown away.