New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow @Description and @ModuleDescription in Excel Workbook and Worksheet modules #5010
Comments
The reason document modules can't have attribute annotations is because we can't export them, add the attributes, and re-import them back in. Best we could do is let these modules have the annotation without treating it as illegal, and have the context/selection toolbar and Code Explorer use the annotations to display descriptions. |
Wouldn't your suggested workaround work for description annotations in general? Do you prefer to store annotations as module attributes? |
Module/member |
Makes sense. Still, it would be nice to have all my descriptions in RD regardless of the mechanism. |
Looking at the Rubberduck/Rubberduck.Core/UI/Command/MenuItems/CommandBars/RubberduckCommandBar.cs Lines 58 to 72 in 0db534e
...as well as the Rubberduck/Rubberduck.Core/Navigation/CodeExplorer/CodeExplorerItemViewModelBase.cs Line 81 in 3b366dc
Looks like all we need to do is amend how the Rubberduck/Rubberduck.Parsing/Symbols/Declaration.cs Lines 284 to 309 in 189aa1c
And that looks fairly easy: simply query the |
A side-effect of this, is that annotated descriptions will start showing up in the Code Explorer and the context/selection toolbar even when there's no corresponding |
oh, I forgot a thing: the Rubberduck/Rubberduck.CodeAnalysis/Inspections/Concrete/IllegalAnnotationInspection.cs Lines 79 to 84 in 0db534e
|
To me that sounds more like a feature than a bug. Is there any reason this behavior would be undesirable? |
Not all side-effects are undesirable! 😃 |
Justification
Most of the VBA I code is in locked down Excel Workbook projects designed to take user input and external data and output summary information, reports or files for import into another program. In this use, individual Excel Worksheets play unique rolls in the process that need to be documented.
Description
I would love to extend Rubberduck's indispensable
@ModuleDescription
and@Description
annotations to include Workbook and Worksheet modules and event the overall Project (Excel or other MS Office file).Worksheets themselves are often intended for specific purposes, such as data entry, syncing data from external sources or summary reporting and a back-end description and I think that documenting that along with the purpose of VBA in those Worksheets is just as helpful here as it is in code and class modules.
In addition to regular procedures, Worksheets can also have Event procedures that need to be documented (I currently document them using my pre-Rubberduck method as a comment inside the procedure). Here's an example description for a
Workbook_AfterSave()
event:Worksheets can have Form Controls that point to procedures on the sheet and ActiveX Controls with procedures directly linked to the procedure name such as
Private Sub MyActiveXButton_Click()
.@ProjectDescription
annotations would also be useful – entered in the Workbook module and displayed when the project is selected in the Code Explorer.The text was updated successfully, but these errors were encountered: