Skip to content

Support optional rendering of AnnotationType type prefix like "note:", "help:", "hint:", etc.  #59

Closed
@ironcev

Description

@ironcev

Perhaps this functionality already exists, but I couldn't find it in any of the options, I also didn't see how it could be manipulated in the resulting DisplayList.

By default, the prefix that denotes the AnnotationType is not rendered for errors and warnings, but it is for all other types of annotations. In the output of the Sway compiler we need the flexibility to show the prefix for some annotations, and for some not.

Consider the following output of the Sway compiler:

07C Constant shadowing - Alias - After 02

We want to have the help: prefix in the footer, but not the info: prefix in the code snippet. In general, we do not want to have any prefixes in the code snippet.

Is there a way already to achieve this functionality?

If not, I would be glad to contribute and implement it.

Activity

added a commit that references this issue on Aug 2, 2023
epage

epage commented on Mar 13, 2024

@epage
Contributor

#97 would add a way to annotate "context" which is independent of Level.

epage

epage commented on Apr 16, 2025

@epage
Contributor

I believe this was fixed by #195, so I'm closing this. If there is something I missed, let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @epage@ironcev

        Issue actions

          Support optional rendering of `AnnotationType` type prefix like "note:", "help:", "hint:", etc. · Issue #59 · rust-lang/annotate-snippets-rs