As already explained, I've recently started properly using CodeRush for Roslyn and have started encountering edge cases, or cases whereby I wouldn't expect them to be flagged. In this particular case it is an event handler but that is attached elsewhere within the code (doesn't contain a handles statement at the end):
Visual BasicPrivate Async Sub TimelineMenuRouteItemClick(ByVal sender As Object, ByVal e As EventArgs)
Would you expect this to be flagged that the e parameter is never used (it follows the event handler signature)?
Mark,
I have reproduced the issue. Our team are working on it. Thank you for your patience.
Mark,
Can you please clarify how you attach the event handler to the event? Ideally, it would be great if you can send us a complete sample with the event handler and the event subscription code.
Hmm… it appears as if I can't reproduce this in a sample project. I will keep trying and if I manage to I'll attach it for your reference.
Mark,
Thank you for the information. Please update this ticket if the issue is reproducible.
Alex, I've managed to get this to happen on an ASP.net WebForms based project. Within my global.asax file I have a number of event handlers such as Application_AcquireRequestState or Application_AuthenticateRequest.
These methods are being flagged for CRR0026 saying that either the sender or e are unused and can be deleted, after which would invalidate the signature if you performed such action.
Mark,
Thank you for the update. I can see the issue now, please give us some time to research it.
Of course Alex
Hopefully this is being fixed but I wanted to show what I am experiencing. I'm getting CRR0026 when a "Handles" clause is included:
Private Sub MainForm_Load(sender As Object, e As EventArgs) Handles MyBase.Load
End Sub
Both "sender" and "e" are tagged as not used and offers to delete them.
In the case of "Handles", "Implements" or "Overrides", there should be no warning generated. These parameters must be there and cannot be deleted.
Hi William,
Thank you for pointing out this issue. We were informed that this issue appears in the 17.2.4 version and have solved it. Please install the following hotfix and let us know whether it solves the issue on your side: DevExpress.CodeRush.Roslyn-17.2.4.17352.vsix.