Add Missing Attribute Quick Fix

Exports the module, adds the hidden attributes as needed, re-imports the temporary file back into the project.

This quick-fix is available for the MissingAttribute inspection

Applicability

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

Examples

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

Before
Module1 (Any)
'@ModuleDescription("Just a module.") Option Explicit '@Description("Does something.") Public Sub DoSomething() End Sub
After
Module1 (Any)
Attribute VB_Description = "Just a module." '@ModuleDescription("Just a module.") Option Explicit '@Description("Does something.") Public Sub DoSomething() Attribute VB_Description = "Does something." End Sub

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