annotate-snippets-rs icon indicating copy to clipboard operation
annotate-snippets-rs copied to clipboard

Allow adding non-`Level` context to `Annotation`s

Open epage opened this issue 1 year ago • 1 comments

Currently, an Annotation is created with a Level. We emulate rustc's "context" style by using a Level::Info but this isn't accurate (and adds a prefix).

epage avatar Mar 12 '24 19:03 epage

Proposal: Add a new enum with states:

enum Unnamed {
    Message,  // in rustc terms, "primary"
    Context, // in rustc terms, "secondary"
    Level(Level), // new to rustc but maintains our current API
    // Added, // for when we support suggestions
    // Removed, // for when we support suggestions
}

We could then create Annotations off of this

I originally called this Style but this is less of a stole and more of a purpose or role of the annotation. Still unsure what to call it.

epage avatar Mar 12 '24 19:03 epage