Skip to content
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

Add $message_type field to distinguish json diagnostic outputs #115691

Merged
merged 8 commits into from
Nov 21, 2023

Commits on Sep 19, 2023

  1. Add type field to json diagnostic outputs

    Currently the json-formatted outputs have no way to unambiguously
    determine which kind of message is being output. A consumer can look for
    specific fields in the json object (eg "message"), but there's no
    guarantee that in future some other kind of output will have a field of
    the same name.
    
    This PR adds a `"type"` field to add json outputs which can be used to
    unambiguously determine which kind of output it is. The mapping is:
    
    diagnostic: regular compiler diagnostics
    artifact: artifact notifications
    future_incompat: Report of future incompatibility
    unused_extern: Unused crate warnings/errors
    
    This matches the "internally tagged" representation for serde enums.
    jsgf committed Sep 19, 2023
    Configuration menu
    Copy the full SHA
    5c81706 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    62ad57b View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    54267dd View commit details
    Browse the repository at this point in the history
  4. Use serde_json::to_writer for JsonEmitter::emit

    Avoids an unnecessary intermediate string.
    jsgf committed Sep 19, 2023
    Configuration menu
    Copy the full SHA
    00adbb2 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    da3df9c View commit details
    Browse the repository at this point in the history

Commits on Oct 13, 2023

  1. Use $message_type as the tag

    `type` turned out to be controversial.
    jsgf committed Oct 13, 2023
    Configuration menu
    Copy the full SHA
    8f08458 View commit details
    Browse the repository at this point in the history

Commits on Oct 16, 2023

  1. Update docs too

    jsgf committed Oct 16, 2023
    Configuration menu
    Copy the full SHA
    8aa4fb5 View commit details
    Browse the repository at this point in the history

Commits on Nov 21, 2023

  1. Configuration menu
    Copy the full SHA
    fe50c53 View commit details
    Browse the repository at this point in the history