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.
In haskell/ghcide#959 I tried to fix a problem with diagnostics:
TypeCheck
) its diagnostics are lostThe assumption in the solution is that starting with the previous diagnostics is sound because they will get updated incrementally as the rules are re-run. If a rule is not re-run then it must have been cut-off and its diagnostics are still valid.
But hold on, the "build" graph is dynamic, so the rules to be run for a file can change at any time! So it's not always the case that if a rule is not re-run, its diagnostics are still valid. For instance, the graph for a non-FOI changes when it becomes a FOI, e.g.
GetModIfaceFromDisk
is not re-run, so its diagnostics will stick around until the file becomes a non-FOI again, andGetModIfaceFromDisk
is re-run.The right solution is to store the diagnostics in our state (the
values
ref):Fixes #1171