Skip to content

Commit ec2954c

Browse files
committed
added xmldocs for annotations, fixes #5380
1 parent d3ee5a5 commit ec2954c

23 files changed

+446
-25
lines changed

Rubberduck.Parsing/Annotations/Concrete/DefaultMemberAnnotation.cs

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,33 @@
77
namespace Rubberduck.Parsing.Annotations
88
{
99
/// <summary>
10-
/// Used for specifying a member's <c>VB_UserMemId</c> attribute value.
10+
/// @DefaultMember annotation, uses the VB_UserMemId attribute to make a class member the default member of that class. Use the quick-fixes to "Rubberduck Opportunities" code inspections to synchronize annotations and attributes.
1111
/// </summary>
12+
/// <parameter>
13+
/// This annotation takes no argument.
14+
/// </parameter>
15+
/// <example>
16+
/// <module name="Class1" type="Class Module">
17+
/// <![CDATA[
18+
/// Option Explicit
19+
/// Private InternalState As VBA.Collection
20+
///
21+
/// @DefaultMember
22+
/// Public Property Get Item(ByVal Index As Variant) As Variant
23+
/// Item = InternalState(Index)
24+
/// End Sub
25+
///
26+
/// 'if the default member is a property, only the Get accessor needs the attribute/annotation.
27+
/// Public Property Let Item(ByVal Index As Variant, ByVal Value As Variant)
28+
/// InternalState(Index) = Value
29+
/// End Sub
30+
///
31+
/// Private Sub Class_Initialize()
32+
/// Set InternalState = New VBA.Collection
33+
/// End Sub
34+
/// ]]>
35+
/// </module>
36+
/// </example>
1237
public sealed class DefaultMemberAnnotation : FixedAttributeValueAnnotationBase
1338
{
1439
public DefaultMemberAnnotation()

Rubberduck.Parsing/Annotations/Concrete/DescriptionAnnotation.cs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,22 @@
55
namespace Rubberduck.Parsing.Annotations
66
{
77
/// <summary>
8-
/// Used for specifying a member's <c>VB_Description</c> attribute.
8+
/// @Description annotation, uses the VB_Description member attribute to provide a docstring for a module member. Use the quick-fixes to "Rubberduck Opportunities" code inspections to synchronize annotations and attributes.
99
/// </summary>
10+
/// <parameter>
11+
/// This annotation takes a single string literal parameter that does not support expressions and/or multiline inputs. The string literal is used as-is as the value of the hidden member attribute.
12+
/// </parameter>
13+
/// <example>
14+
/// <module name="Class1" type="Class Module">
15+
/// <![CDATA[
16+
/// Option Explicit
17+
///
18+
/// @Description("Does something")
19+
/// Public Sub DoSomething()
20+
/// End Sub
21+
/// ]]>
22+
/// </module>
23+
/// </example>
1024
public sealed class DescriptionAnnotation : DescriptionAttributeAnnotationBase
1125
{
1226
public DescriptionAnnotation()

Rubberduck.Parsing/Annotations/Concrete/EnumeratorMemberAnnotation.cs

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,28 @@
66
namespace Rubberduck.Parsing.Annotations
77
{
88
/// <summary>
9-
/// Used for specifying a member's <c>VB_UserMemId</c> attribute value.
9+
/// @Enumerator annotation, uses the VB_UserMemId attribute to make a class member the enumerator-provider member of that class, enabling For Each iteration of custom collections. Use the quick-fixes to "Rubberduck Opportunities" code inspections to synchronize annotations and attributes.
1010
/// </summary>
11+
/// <parameter>
12+
/// This annotation takes no argument.
13+
/// </parameter>
14+
/// <example>
15+
/// <module name="Class1" type="Class Module">
16+
/// <![CDATA[
17+
/// Option Explicit
18+
/// Private InternalState As VBA.Collection
19+
///
20+
/// @Enumerator
21+
/// Public Property Get NewEnum() As IUnknown
22+
/// Set NewEnum = InternalState.[_NewEnum]
23+
/// End Sub
24+
///
25+
/// Private Sub Class_Initialize()
26+
/// Set InternalState = New VBA.Collection
27+
/// End Sub
28+
/// ]]>
29+
/// </module>
30+
/// </example>
1131
public sealed class EnumeratorMemberAnnotation : FixedAttributeValueAnnotationBase
1232
{
1333
public EnumeratorMemberAnnotation()

Rubberduck.Parsing/Annotations/Concrete/ExcelHotKeyAnnotation.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,24 @@
77

88
namespace Rubberduck.Parsing.Annotations
99
{
10+
/// <summary>
11+
/// @ExcelHotkey annotation, uses a VB_ProcData.VB_Invoke_Func metadata attribute to map a hotkey to a standard module procedure. Use the quick-fixes to "Rubberduck Opportunities" code inspections to synchronize annotations and attributes.
12+
/// </summary>
13+
/// <parameter>
14+
/// This annotation requires a single-letter string argument to map the hotkey. If the letter is in UPPER CASE, the hotkey is Ctrl+Shift+letter; if the letter is lower case, the hotkey is Ctrl+letter. Avoid remapping commonly used keyboard shortcuts!
15+
/// </parameter>
16+
/// <example>
17+
/// <module name="Module1" type="Standard Module">
18+
/// <![CDATA[
19+
/// Option Explicit
20+
///
21+
/// @ExcelHotkey("D")
22+
/// Public Sub DoSomething()
23+
/// '...
24+
/// End Sub
25+
/// ]]>
26+
/// </module>
27+
/// </example>
1028
public sealed class ExcelHotKeyAnnotation : FlexibleAttributeValueAnnotationBase
1129
{
1230
public ExcelHotKeyAnnotation()

Rubberduck.Parsing/Annotations/Concrete/ExposedModuleAnnotation.cs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,22 @@
55
namespace Rubberduck.Parsing.Annotations
66
{
77
/// <summary>
8-
/// Used for specifying a module's <c>VB_Exposed</c> attribute.
8+
/// @Exposed annotation, uses the VB_Exposed module attribute to make a class visible to a referencing project (classes are otherwise private). Use the quick-fixes to "Rubberduck Opportunities" code inspections to synchronize annotations and attributes.
99
/// </summary>
10+
/// <parameter>
11+
/// This annotation takes no argument.
12+
/// </parameter>
13+
/// <example>
14+
/// <module name="Class1" type="Class Module">
15+
/// <![CDATA[
16+
/// '@Exposed
17+
/// Option Explicit
18+
///
19+
/// Public Sub DoSomething()
20+
/// End Sub
21+
/// ]]>
22+
/// </module>
23+
/// </example>
1024
public sealed class ExposedModuleAnnotation : FixedAttributeValueAnnotationBase
1125
{
1226
public ExposedModuleAnnotation()

Rubberduck.Parsing/Annotations/Concrete/FolderAnnotation.cs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,22 @@
11
namespace Rubberduck.Parsing.Annotations
22
{
33
/// <summary>
4-
/// Used for specifying the Code Explorer folder a appears under.
4+
/// @Folder annotation, determines where in a custom folder structure a given module appears in the Code Explorer toolwindow.
55
/// </summary>
6+
/// <parameter>
7+
/// This annotation takes a single string literal argument that uses the dot "." character to indicate parent/child folders. Consider using folder names that are valid in the file system; PascalCase names is ideal.
8+
/// </parameter>
9+
/// <example>
10+
/// <module name="Class1" type="Class Module">
11+
/// <![CDATA[
12+
/// '@Folder("Parent.Child.SubChild")
13+
/// Option Explicit
14+
///
15+
/// Public Sub DoSomething()
16+
/// End Sub
17+
/// ]]>
18+
/// </module>
19+
/// </example>
620
public sealed class FolderAnnotation : AnnotationBase
721
{
822
public FolderAnnotation()

Rubberduck.Parsing/Annotations/Concrete/IgnoreAnnotation.cs

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,35 @@
11
namespace Rubberduck.Parsing.Annotations
22
{
33
/// <summary>
4-
/// Used for ignoring specific inspection results from a specified set of inspections.
4+
/// @Ignore annotation, used for ignoring inspection results at member and local level.
55
/// </summary>
6+
/// <parameter>
7+
/// This annotation optionally takes a comma-separated list of inspection names as argument. If no specific inspection is provided, then all inspections would ignore the annotated target.
8+
/// </parameter>
9+
/// <remarks>
10+
/// Use the @IgnoreModule annotation to annotate at module level.
11+
/// </remarks>
12+
/// <example>
13+
/// <module name="Class1" type="Class Module">
14+
/// <![CDATA[
15+
/// Option Explicit
16+
/// Private InternalState As VBA.Collection
17+
///
18+
/// '@Ignore
19+
/// Public Sub DoSomething(ByRef foo As Long)
20+
/// foo = 42
21+
/// End Sub
22+
///
23+
/// '@Ignore ProcedureNotUsed
24+
/// Public Sub DoSomethingElse()
25+
/// '@Ignore VariableNotAssigned
26+
/// Dim result As Variant
27+
/// DoSomething result
28+
/// Debug.Print result
29+
/// End Sub
30+
/// ]]>
31+
/// </module>
32+
/// </example>
633
public sealed class IgnoreAnnotation : AnnotationBase
734
{
835
public IgnoreAnnotation()

Rubberduck.Parsing/Annotations/Concrete/IgnoreModuleAnnotation.cs

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,37 @@
11
namespace Rubberduck.Parsing.Annotations
22
{
33
/// <summary>
4-
/// This annotation allows ignoring inspection results of defined inspections for a whole module
4+
/// @IgnoreModule annotation, used for ignoring inspection results module-wide.
55
/// </summary>
6+
/// <parameter>
7+
/// This annotation optionally takes a comma-separated list of inspection names as argument. If no specific inspection is provided, then all inspections would ignore the annotated module.
8+
/// </parameter>
9+
/// <remarks>
10+
/// Use this annotation judiciously: while it silences false positives, it also silences legitimate inspection results.
11+
/// </remarks>
12+
/// <example>
13+
/// <module name="Class1" type="Class Module">
14+
/// <![CDATA[
15+
/// '@IgnoreModule
16+
/// Option Explicit
17+
///
18+
/// Public Sub DoSomething()
19+
/// End Sub
20+
/// ]]>
21+
/// </module>
22+
/// </example>
23+
/// <example>
24+
/// <module name="Class1" type="Class Module">
25+
/// <![CDATA[
26+
/// '@IgnoreModule UndeclaredVariable, VariableNotUsed, VariableNotAssigned, UnassignedVariableUsage
27+
///
28+
/// Public Sub DoSomething()
29+
/// foo = 42
30+
/// Debug.Print bar
31+
/// End Sub
32+
/// ]]>
33+
/// </module>
34+
/// </example>
635
public sealed class IgnoreModuleAnnotation : AnnotationBase
736
{
837
public IgnoreModuleAnnotation()

Rubberduck.Parsing/Annotations/Concrete/IgnoreTestAnnotation.cs

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,30 @@
11
namespace Rubberduck.Parsing.Annotations
22
{
33
/// <summary>
4-
/// Used to indicate the test engine that a unit test is to be ignored.
4+
/// @IgnoreTest annotation, used for ignoring a particular unit test in a test module.
55
/// </summary>
6+
/// <parameter>
7+
/// This annotation takes no argument.
8+
/// </parameter>
9+
/// <remarks>
10+
/// Test Explorer will skip tests decorated with this annotation.
11+
/// </remarks>
12+
/// <example>
13+
/// <module name="Tests" type="Standard Module">
14+
/// <![CDATA[
15+
/// '@TestModule
16+
/// Option Explicit
17+
///
18+
/// '...
19+
///
20+
/// '@IgnoreTest
21+
/// '@TestMethod("Category")
22+
/// Private Sub GivenFoo_DoesBar()
23+
/// '...
24+
/// End Sub
25+
/// ]]>
26+
/// </module>
27+
/// </example>
628
public sealed class IgnoreTestAnnotation : AnnotationBase
729
{
830
public IgnoreTestAnnotation()

Rubberduck.Parsing/Annotations/Concrete/InterfaceAnnotation.cs

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,25 @@
11
namespace Rubberduck.Parsing.Annotations
22
{
33
/// <summary>
4-
/// Used to mark a class module as an interface, so that Rubberduck treats it as such even if it's not implemented in any opened project.
4+
/// @Interface annotation, marks a class as an abstract interface; Rubberduck can use this valuable metadata in its code analysis.
55
/// </summary>
6+
/// <parameter>
7+
/// This annotation takes no argument.
8+
/// </parameter>
9+
/// <remarks>
10+
/// Code Explorer uses an "interface" icon to represent class modules with this annotation.
11+
/// </remarks>
12+
/// <example>
13+
/// <module name="Tests" type="Standard Module">
14+
/// <![CDATA[
15+
/// '@Interface
16+
/// Option Explicit
17+
///
18+
/// Public Sub DoSomething()
19+
/// End Sub
20+
/// ]]>
21+
/// </module>
22+
/// </example>
623
public sealed class InterfaceAnnotation : AnnotationBase
724
{
825
public InterfaceAnnotation()

0 commit comments

Comments
 (0)