For another addin which alters VBA code, I use my own annotation @notrace.
I guess I'll have to use some other prefix character if I want to use RD as well?
Public Sub O(ByVal ProjectLineNumber As Long, Optional ByVal Message As String) '@notrace
Annotation "notrace" is illegal in this context
An annotation meant to be specified at module level cannot be used to annotate members.
By the way, it would be handy to have a button or right-click shortcut to copy just this current inspection I am looking at so I can copy it and the error message into this issue report.
Also see Annotations: Non-Rubberduck annotations shouldn't throw parser error #1426
Rubberduck version information
Version 2.4.1.4729
OS: Microsoft Windows NT 10.0.17134.0, x64
Host Product: Microsoft Office x86
Host Version: 16.0.11629.20196
Host Executable: EXCEL.EXE
By the way, it would be handy to have a button or right-click shortcut to copy just this current inspection I am looking at so I can copy it and the error message into this issue report.
That's a neat idea! Seconded!
I think this @CustomAnnotationForNonDuckyPurposes warrants making IllegalAnnotation inspection simply ignore any annotation that isn't recognized as a RD annotation - note that this is different than the linked issue, where this was a parser-level issue.
Then you'll have people complaining that their misspelt @Golder annotation was not reported. It's a tough call; one of us will have to give way; I guess I'll be the ship and you'll be the island.
Actually the "correct" solution to this is to have an allowlist for unknown annotations with a corresponding quickfix to enable users to allow certain annotations
Splicing IllegalAnnotationInspection into 3 distinct inspections also adequately addresses this concern I think:
InvalidAnnotationInspection flags known but unbound annotations.AnnotationInIncompatibleComponentTypeInspection flags known annotations specified in an incompatible module type.UnrecognizedAnnotationInspection would flag typos and "homegrown" annotations as "not a supported Rubberduck annotation".The _unrecognized annotation_ inspection could be disabled separately from unbound or otherwise invalid annotations, effectively muting @notrace while still validating the proper use of e.g. @PredeclaredId.
Most helpful comment
Actually the "correct" solution to this is to have an allowlist for unknown annotations with a corresponding quickfix to enable users to allow certain annotations