Skip to content

Diff rendering assumptions #20080

@ntBre

Description

@ntBre

I only just realized that our fix infrastructure always assumes that all changes belong to the file from the primary span.

How would the rendered diagnostic look like if we had a sub-diagnostic with a span pointing to a different file? I don't think it's something we have to solve now but it might be worth documenting if the rendered output looks confusing.

Originally posted by @MichaReiser in #20036 (comment)

Beyond the implicit fix-primary-span connection, we'll also render diffs immediately after the last diagnostic, whether that fits nicely or not. Especially after the planned changes in #19919, the diffs will be expecting a help: header above them, which will be missing if an additional sub-diagnostic has been added before the help message.

These issues shouldn't affect any existing diagnostics yet, but they're something to look out for as we start using the new diagnostic features more extensively.

Metadata

Metadata

Assignees

No one assigned

    Labels

    diagnosticsRelated to reporting of diagnostics.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions