Skip to content
This repository has been archived by the owner on Mar 22, 2023. It is now read-only.

Example code for each Inspection #32

Closed
EBrown8534 opened this issue Dec 18, 2016 · 3 comments
Closed

Example code for each Inspection #32

EBrown8534 opened this issue Dec 18, 2016 · 3 comments

Comments

@EBrown8534
Copy link
Member

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
Copy link
Member

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
Copy link
Member

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

@retailcoder
Copy link
Member

This is now live! 🎉

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants