refactor(interface): Update annotation_snippets emitter #602
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.
Resolve #592
I think the linked issue explains the motivation well enough. I'll list the considerations and changes here for clarity:
that are duplicated or not well structured are kept.
There are part that data is cloning to preserve the ported code behavior.
FileNameand source code handling are simplified as Solardoes not need to handle as much cases as Rustc.
the diagnostic in 4 parts, while Rustc does not separate into parts at all.
I made the change to keep the footer part, and the rest are combined into one like in Rustc.
diagnostics/emitter/rustc.rscompletely obsolete.I still kept it though in case that
FileWithAnnotatedLines::collect_annotations's behavior is more desired.Overall, there is only one test output changed, which is due to the mentioned change in emitter behavior.
I'm surprised that the behavior stayed mostly the same.
Please take a look and let me know if there are any issues. I think the code can be refactored further, either in
this PR or in a separate one.