rubberduck-vba / RubberduckWeb

Project Website for the Rubberduck VBA Editor Add-In
19 stars 12 forks source link

Example code for each Inspection #32

Closed EBrown8534 closed 5 years ago

EBrown8534 commented 7 years ago

I was thinking last night in the middle of the night that we should have example code blocks that would trigger each inspection on the detail page of the inspection.

We already have a template and style for a "mock VBE debugger" that we could use to make it look/feel like VBA code.

I.e.: for Option Explicit Inspection:

Public Sub Test()
End Sub

Would highlight line 1.

retailcoder commented 7 years ago

I don't know about the highlighting, but I was thinking to add two resource strings per inspection the other day (looking at the generated "details" pages). One would be a snippet that triggers the inspection, the other would be a similar snippet that doesn't trigger it.

For example, this would trigger UnassignedVariableUsage:

Private Sub DoSomething()
    Dim foo As Long
    Debug.Print foo
End Sub

And this similar snippet wouldn't:

Private Sub DoSomething()
    Dim foo As Long
    foo = 42
    Debug.Print foo
End Sub
retailcoder commented 6 years ago

This needs to be xml-doc comments in the inspections' code.

retailcoder commented 5 years ago

This is now live! 🎉