Introduce Local Variable Quick Fix

Introduces a local Variant variable for an otherwise undeclared identifier.

This quick-fix is available for the UndeclaredVariable inspection


This quick-fix can be applied as a single operation at the following scopes:
  • Procedure
  • Module
  • Project


 This example depicts the state of module(s) before and after applying the quick-fix.

Module1 (Any)
Public Sub DoSomething() value = 42 Debug.Print value End Sub
Module1 (Any)
Public Sub DoSomething() Dim value As Variant value = 42 Debug.Print value End Sub

Rubberduck.CodeAnalysis.QuickFixes.Concrete.IntroduceLocalVariableQuickFix.cs (Prerelease-v2.5.2.6174)