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

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

Open ironcev opened this issue 2 years ago • 1 comments

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.

ironcev avatar Jul 31 '23 08:07 ironcev

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

epage avatar Mar 13 '24 15:03 epage