From 1cee0fdcbf748d88f443c031d112c7ee97e8365a Mon Sep 17 00:00:00 2001 From: IvenBach Date: Tue, 7 Jan 2020 10:19:12 -0800 Subject: [PATCH 01/30] Opportunistic updates Make boolean usage more apparent. Correct typo. Simplify member access. Simplify string initialization. --- .../UI/Command/ComCommands/ExportAllCommand.cs | 8 +++----- .../SafeComWrappers/VB/Abstract/IVBComponent.cs | 2 +- Rubberduck.VBEditor.VB6/SafeComWrappers/VB/VBComponent.cs | 6 +++--- Rubberduck.VBEditor.VBA/SafeComWrappers/VB/VBComponent.cs | 8 ++++---- 4 files changed, 11 insertions(+), 13 deletions(-) diff --git a/Rubberduck.Core/UI/Command/ComCommands/ExportAllCommand.cs b/Rubberduck.Core/UI/Command/ComCommands/ExportAllCommand.cs index 21c777cc98..cc1cfe6174 100644 --- a/Rubberduck.Core/UI/Command/ComCommands/ExportAllCommand.cs +++ b/Rubberduck.Core/UI/Command/ComCommands/ExportAllCommand.cs @@ -92,11 +92,9 @@ private void Export(IVBProject project) // If .GetDirectoryName is passed an empty string for a RootFolder, // it defaults to the Documents library (Win 7+) or equivalent. - var path = string.Empty; - if (!string.IsNullOrWhiteSpace(project.FileName)) - { - path = Path.GetDirectoryName(project.FileName); - } + var path = string.IsNullOrWhiteSpace(project.FileName) + ? string.Empty + : Path.GetDirectoryName(project.FileName); using (var _folderBrowser = _factory.CreateFolderBrowser(desc, true, path)) { diff --git a/Rubberduck.VBEEditor/SafeComWrappers/VB/Abstract/IVBComponent.cs b/Rubberduck.VBEEditor/SafeComWrappers/VB/Abstract/IVBComponent.cs index 117eecc132..24bbe3c384 100644 --- a/Rubberduck.VBEEditor/SafeComWrappers/VB/Abstract/IVBComponent.cs +++ b/Rubberduck.VBEEditor/SafeComWrappers/VB/Abstract/IVBComponent.cs @@ -20,7 +20,7 @@ public interface IVBComponent : ISafeComWrapper, IEquatable IWindow DesignerWindow(); void Activate(); void Export(string path); - string ExportAsSourceFile(string folder, bool tempFile = false, bool specialCaseDocumentModules = true); + string ExportAsSourceFile(string folder, bool isTempFile = false, bool specialCaseDocumentModules = true); int FileCount { get; } string GetFileName(short index); IVBProject ParentProject { get; } diff --git a/Rubberduck.VBEditor.VB6/SafeComWrappers/VB/VBComponent.cs b/Rubberduck.VBEditor.VB6/SafeComWrappers/VB/VBComponent.cs index a52bdf7c1c..b38bdd9da9 100644 --- a/Rubberduck.VBEditor.VB6/SafeComWrappers/VB/VBComponent.cs +++ b/Rubberduck.VBEditor.VB6/SafeComWrappers/VB/VBComponent.cs @@ -123,9 +123,9 @@ public bool HasDesigner /// Exports the component to the folder. The file name matches the component name and file extension is based on the component's type. /// /// Destination folder for the resulting source file. - /// True if a unique temp file name should be generated. WARNING: filenames generated with this flag are not persisted. - /// If reimpot of a document file is required later, it has to receive special treatment. - public string ExportAsSourceFile(string folder, bool tempFile = false, bool specialCaseDocumentModules = true) + /// True if a unique temp file name should be generated. WARNING: filenames generated with this flag are not persisted. + /// If reimport of a document file is required later, it has to receive special treatment. + public string ExportAsSourceFile(string folder, bool isTempFile = false, bool specialCaseDocumentModules = true) { throw new NotSupportedException("Export as source file is not supported in VB6"); } diff --git a/Rubberduck.VBEditor.VBA/SafeComWrappers/VB/VBComponent.cs b/Rubberduck.VBEditor.VBA/SafeComWrappers/VB/VBComponent.cs index 8d6e12b501..b25ea13678 100644 --- a/Rubberduck.VBEditor.VBA/SafeComWrappers/VB/VBComponent.cs +++ b/Rubberduck.VBEditor.VBA/SafeComWrappers/VB/VBComponent.cs @@ -95,14 +95,14 @@ public bool HasDesigner /// Exports the component to the folder. The file name matches the component name and file extension is based on the component's type. /// /// Destination folder for the resulting source file. - /// True if a unique temp file name should be generated. WARNING: filenames generated with this flag are not persisted. + /// True if a unique temp file name should be generated. WARNING: filenames generated with this flag are not persisted. /// If reimport of a document file is required later, it has to receive special treatment. - public string ExportAsSourceFile(string folder, bool tempFile = false, bool specialCaseDocumentModules = true) + public string ExportAsSourceFile(string folder, bool isTempFile = false, bool specialCaseDocumentModules = true) { //TODO: this entire thign needs to be reworked. IO is not the class' concern. //We probably need to leverage IPersistancePathProvider? ITempSourceFileHandler? //Just not here. - var fullPath = tempFile + var fullPath = isTempFile ? Path.Combine(folder, Path.GetRandomFileName()) : Path.Combine(folder, SafeName + Type.FileExtension()); @@ -160,7 +160,7 @@ private void ExportUserFormModule(string path) var tempFile = ExportToTempFile(); var tempFilePath = Directory.GetParent(tempFile).FullName; - var fileEncoding = System.Text.Encoding.Default; //We use the current ANSI codepage because that is what the VBE does. + var fileEncoding = Encoding.Default; //We use the current ANSI codepage because that is what the VBE does. var contents = File.ReadAllLines(tempFile, fileEncoding); var nonAttributeLines = contents.TakeWhile(line => !line.StartsWith("Attribute")).Count(); var attributeLines = contents.Skip(nonAttributeLines).TakeWhile(line => line.StartsWith("Attribute")).Count(); From b6efda0ceabce023879a79566f33620a621347fc Mon Sep 17 00:00:00 2001 From: IvenBach Date: Tue, 7 Jan 2020 11:16:59 -0800 Subject: [PATCH 02/30] Export document modules without attributes --- .../UI/CodeExplorer/Commands/ExportCommand.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/Rubberduck.Core/UI/CodeExplorer/Commands/ExportCommand.cs b/Rubberduck.Core/UI/CodeExplorer/Commands/ExportCommand.cs index 872cba767e..0d41a2db60 100644 --- a/Rubberduck.Core/UI/CodeExplorer/Commands/ExportCommand.cs +++ b/Rubberduck.Core/UI/CodeExplorer/Commands/ExportCommand.cs @@ -100,7 +100,15 @@ public bool PromptFileNameAndExport(QualifiedModuleName qualifiedModule) var component = ProjectsProvider.Component(qualifiedModule); try { - component.Export(dialog.FileName); + if (component.Type == ComponentType.Document) + { + var path = System.IO.Path.GetDirectoryName(dialog.FileName); + component.ExportAsSourceFile(path); + } + else + { + component.Export(dialog.FileName); + } } catch (Exception ex) { From 1b69ca4f789206b1f5f8c0f900e2946a52ef241b Mon Sep 17 00:00:00 2001 From: IvenBach Date: Thu, 20 Feb 2020 16:05:24 -0800 Subject: [PATCH 03/30] Don't special case document modules --- .../UI/CodeExplorer/Commands/ExportCommand.cs | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/Rubberduck.Core/UI/CodeExplorer/Commands/ExportCommand.cs b/Rubberduck.Core/UI/CodeExplorer/Commands/ExportCommand.cs index 0d41a2db60..1755a183f4 100644 --- a/Rubberduck.Core/UI/CodeExplorer/Commands/ExportCommand.cs +++ b/Rubberduck.Core/UI/CodeExplorer/Commands/ExportCommand.cs @@ -100,15 +100,8 @@ public bool PromptFileNameAndExport(QualifiedModuleName qualifiedModule) var component = ProjectsProvider.Component(qualifiedModule); try { - if (component.Type == ComponentType.Document) - { - var path = System.IO.Path.GetDirectoryName(dialog.FileName); - component.ExportAsSourceFile(path); - } - else - { - component.Export(dialog.FileName); - } + var path = System.IO.Path.GetDirectoryName(dialog.FileName); + component.ExportAsSourceFile(path); } catch (Exception ex) { From d3ee5a5b9f0ff436cd27b0e81edada0b57d62784 Mon Sep 17 00:00:00 2001 From: Mathieu Guindon Date: Sun, 26 Apr 2020 16:11:16 -0400 Subject: [PATCH 04/30] generate xmldocs for Rubberduck.Parsing --- Rubberduck.Parsing/Rubberduck.Parsing.csproj | 1 + 1 file changed, 1 insertion(+) diff --git a/Rubberduck.Parsing/Rubberduck.Parsing.csproj b/Rubberduck.Parsing/Rubberduck.Parsing.csproj index 72aedf612d..60928e3314 100644 --- a/Rubberduck.Parsing/Rubberduck.Parsing.csproj +++ b/Rubberduck.Parsing/Rubberduck.Parsing.csproj @@ -13,6 +13,7 @@ 1 true 1701;1702;1591;4011;1001;7035;1053 + Rubberduck.Parsing.xml True From ec2954c3f24f100dcf9effa32e0fbee075ad09f3 Mon Sep 17 00:00:00 2001 From: Mathieu Guindon Date: Sun, 26 Apr 2020 17:58:59 -0400 Subject: [PATCH 05/30] added xmldocs for annotations, fixes #5380 --- .../Concrete/DefaultMemberAnnotation.cs | 27 +++++++++++++++- .../Concrete/DescriptionAnnotation.cs | 16 +++++++++- .../Concrete/EnumeratorMemberAnnotation.cs | 22 ++++++++++++- .../Concrete/ExcelHotKeyAnnotation.cs | 18 +++++++++++ .../Concrete/ExposedModuleAnnotation.cs | 16 +++++++++- .../Annotations/Concrete/FolderAnnotation.cs | 16 +++++++++- .../Annotations/Concrete/IgnoreAnnotation.cs | 29 ++++++++++++++++- .../Concrete/IgnoreModuleAnnotation.cs | 31 ++++++++++++++++++- .../Concrete/IgnoreTestAnnotation.cs | 24 +++++++++++++- .../Concrete/InterfaceAnnotation.cs | 19 +++++++++++- .../Concrete/MemberAttributeAnnotation.cs | 20 ++++++++++-- .../Concrete/ModuleAttributeAnnotation.cs | 16 +++++++++- .../Concrete/ModuleCleanupAnnotation.cs | 20 +++++++++++- .../Concrete/ModuleDescriptionAnnotation.cs | 18 +++++++++-- .../Concrete/ModuleInitializeAnnotation.cs | 20 +++++++++++- .../Concrete/NoIndentAnnotation.cs | 16 +++++++++- .../Concrete/ObsoleteAnnotation.cs | 19 +++++++++++- .../Concrete/PredeclaredIdAnnotation.cs | 20 +++++++++++- .../Concrete/TestCleanupAnnotation.cs | 21 ++++++++++++- .../Concrete/TestInitializeAnnotation.cs | 21 ++++++++++++- .../Concrete/TestMethodAnnotation.cs | 22 ++++++++++++- .../Concrete/TestModuleAnnotation.cs | 18 +++++++++-- .../Concrete/VariableDescriptionAnnotation.cs | 22 +++++++++++++ 23 files changed, 446 insertions(+), 25 deletions(-) diff --git a/Rubberduck.Parsing/Annotations/Concrete/DefaultMemberAnnotation.cs b/Rubberduck.Parsing/Annotations/Concrete/DefaultMemberAnnotation.cs index 090ffa005e..f478ccc7e1 100644 --- a/Rubberduck.Parsing/Annotations/Concrete/DefaultMemberAnnotation.cs +++ b/Rubberduck.Parsing/Annotations/Concrete/DefaultMemberAnnotation.cs @@ -7,8 +7,33 @@ namespace Rubberduck.Parsing.Annotations { /// - /// Used for specifying a member's VB_UserMemId attribute value. + /// @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. /// + /// + /// This annotation takes no argument. + /// + /// + /// + /// + /// + /// public sealed class DefaultMemberAnnotation : FixedAttributeValueAnnotationBase { public DefaultMemberAnnotation() diff --git a/Rubberduck.Parsing/Annotations/Concrete/DescriptionAnnotation.cs b/Rubberduck.Parsing/Annotations/Concrete/DescriptionAnnotation.cs index 1bbed06265..dfd0b97005 100644 --- a/Rubberduck.Parsing/Annotations/Concrete/DescriptionAnnotation.cs +++ b/Rubberduck.Parsing/Annotations/Concrete/DescriptionAnnotation.cs @@ -5,8 +5,22 @@ namespace Rubberduck.Parsing.Annotations { /// - /// Used for specifying a member's VB_Description attribute. + /// @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. /// + /// + /// 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. + /// + /// + /// + /// + /// + /// public sealed class DescriptionAnnotation : DescriptionAttributeAnnotationBase { public DescriptionAnnotation() diff --git a/Rubberduck.Parsing/Annotations/Concrete/EnumeratorMemberAnnotation.cs b/Rubberduck.Parsing/Annotations/Concrete/EnumeratorMemberAnnotation.cs index 22bfc8bca0..4763a1f4e5 100644 --- a/Rubberduck.Parsing/Annotations/Concrete/EnumeratorMemberAnnotation.cs +++ b/Rubberduck.Parsing/Annotations/Concrete/EnumeratorMemberAnnotation.cs @@ -6,8 +6,28 @@ namespace Rubberduck.Parsing.Annotations { /// - /// Used for specifying a member's VB_UserMemId attribute value. + /// @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. /// + /// + /// This annotation takes no argument. + /// + /// + /// + /// + /// + /// public sealed class EnumeratorMemberAnnotation : FixedAttributeValueAnnotationBase { public EnumeratorMemberAnnotation() diff --git a/Rubberduck.Parsing/Annotations/Concrete/ExcelHotKeyAnnotation.cs b/Rubberduck.Parsing/Annotations/Concrete/ExcelHotKeyAnnotation.cs index b1bdcce09b..984049d3b4 100644 --- a/Rubberduck.Parsing/Annotations/Concrete/ExcelHotKeyAnnotation.cs +++ b/Rubberduck.Parsing/Annotations/Concrete/ExcelHotKeyAnnotation.cs @@ -7,6 +7,24 @@ namespace Rubberduck.Parsing.Annotations { + /// + /// @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. + /// + /// + /// 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! + /// + /// + /// + /// + /// + /// public sealed class ExcelHotKeyAnnotation : FlexibleAttributeValueAnnotationBase { public ExcelHotKeyAnnotation() diff --git a/Rubberduck.Parsing/Annotations/Concrete/ExposedModuleAnnotation.cs b/Rubberduck.Parsing/Annotations/Concrete/ExposedModuleAnnotation.cs index 3ba70ee34f..924a3fd9de 100644 --- a/Rubberduck.Parsing/Annotations/Concrete/ExposedModuleAnnotation.cs +++ b/Rubberduck.Parsing/Annotations/Concrete/ExposedModuleAnnotation.cs @@ -5,8 +5,22 @@ namespace Rubberduck.Parsing.Annotations { /// - /// Used for specifying a module's VB_Exposed attribute. + /// @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. /// + /// + /// This annotation takes no argument. + /// + /// + /// + /// + /// + /// public sealed class ExposedModuleAnnotation : FixedAttributeValueAnnotationBase { public ExposedModuleAnnotation() diff --git a/Rubberduck.Parsing/Annotations/Concrete/FolderAnnotation.cs b/Rubberduck.Parsing/Annotations/Concrete/FolderAnnotation.cs index ea8200337f..01fe5c44f5 100644 --- a/Rubberduck.Parsing/Annotations/Concrete/FolderAnnotation.cs +++ b/Rubberduck.Parsing/Annotations/Concrete/FolderAnnotation.cs @@ -1,8 +1,22 @@ namespace Rubberduck.Parsing.Annotations { /// - /// Used for specifying the Code Explorer folder a appears under. + /// @Folder annotation, determines where in a custom folder structure a given module appears in the Code Explorer toolwindow. /// + /// + /// 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. + /// + /// + /// + /// + /// + /// public sealed class FolderAnnotation : AnnotationBase { public FolderAnnotation() diff --git a/Rubberduck.Parsing/Annotations/Concrete/IgnoreAnnotation.cs b/Rubberduck.Parsing/Annotations/Concrete/IgnoreAnnotation.cs index 736a0d6b3a..34b8c86d63 100644 --- a/Rubberduck.Parsing/Annotations/Concrete/IgnoreAnnotation.cs +++ b/Rubberduck.Parsing/Annotations/Concrete/IgnoreAnnotation.cs @@ -1,8 +1,35 @@ namespace Rubberduck.Parsing.Annotations { /// - /// Used for ignoring specific inspection results from a specified set of inspections. + /// @Ignore annotation, used for ignoring inspection results at member and local level. /// + /// + /// 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. + /// + /// + /// Use the @IgnoreModule annotation to annotate at module level. + /// + /// + /// + /// + /// + /// public sealed class IgnoreAnnotation : AnnotationBase { public IgnoreAnnotation() diff --git a/Rubberduck.Parsing/Annotations/Concrete/IgnoreModuleAnnotation.cs b/Rubberduck.Parsing/Annotations/Concrete/IgnoreModuleAnnotation.cs index 70c9a3902e..6ab8eee7df 100644 --- a/Rubberduck.Parsing/Annotations/Concrete/IgnoreModuleAnnotation.cs +++ b/Rubberduck.Parsing/Annotations/Concrete/IgnoreModuleAnnotation.cs @@ -1,8 +1,37 @@ namespace Rubberduck.Parsing.Annotations { /// - /// This annotation allows ignoring inspection results of defined inspections for a whole module + /// @IgnoreModule annotation, used for ignoring inspection results module-wide. /// + /// + /// 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. + /// + /// + /// Use this annotation judiciously: while it silences false positives, it also silences legitimate inspection results. + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// public sealed class IgnoreModuleAnnotation : AnnotationBase { public IgnoreModuleAnnotation() diff --git a/Rubberduck.Parsing/Annotations/Concrete/IgnoreTestAnnotation.cs b/Rubberduck.Parsing/Annotations/Concrete/IgnoreTestAnnotation.cs index 0a788bdecd..1b5cf8d4b6 100644 --- a/Rubberduck.Parsing/Annotations/Concrete/IgnoreTestAnnotation.cs +++ b/Rubberduck.Parsing/Annotations/Concrete/IgnoreTestAnnotation.cs @@ -1,8 +1,30 @@ namespace Rubberduck.Parsing.Annotations { /// - /// Used to indicate the test engine that a unit test is to be ignored. + /// @IgnoreTest annotation, used for ignoring a particular unit test in a test module. /// + /// + /// This annotation takes no argument. + /// + /// + /// Test Explorer will skip tests decorated with this annotation. + /// + /// + /// + /// + /// + /// public sealed class IgnoreTestAnnotation : AnnotationBase { public IgnoreTestAnnotation() diff --git a/Rubberduck.Parsing/Annotations/Concrete/InterfaceAnnotation.cs b/Rubberduck.Parsing/Annotations/Concrete/InterfaceAnnotation.cs index 664ee683aa..04c5e3b6e2 100644 --- a/Rubberduck.Parsing/Annotations/Concrete/InterfaceAnnotation.cs +++ b/Rubberduck.Parsing/Annotations/Concrete/InterfaceAnnotation.cs @@ -1,8 +1,25 @@ namespace Rubberduck.Parsing.Annotations { /// - /// 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. + /// @Interface annotation, marks a class as an abstract interface; Rubberduck can use this valuable metadata in its code analysis. /// + /// + /// This annotation takes no argument. + /// + /// + /// Code Explorer uses an "interface" icon to represent class modules with this annotation. + /// + /// + /// + /// + /// + /// public sealed class InterfaceAnnotation : AnnotationBase { public InterfaceAnnotation() diff --git a/Rubberduck.Parsing/Annotations/Concrete/MemberAttributeAnnotation.cs b/Rubberduck.Parsing/Annotations/Concrete/MemberAttributeAnnotation.cs index 725646c3f3..eab209b826 100644 --- a/Rubberduck.Parsing/Annotations/Concrete/MemberAttributeAnnotation.cs +++ b/Rubberduck.Parsing/Annotations/Concrete/MemberAttributeAnnotation.cs @@ -5,12 +5,26 @@ namespace Rubberduck.Parsing.Annotations { /// - /// This annotation allows the specification of arbitrary VB_Attribute entries for members. + /// @MemberAttribute annotation, allows specifying arbitrary VB_Attribute for members. Use the quick-fixes to "Rubberduck Opportunities" code inspections to synchronize annotations and attributes. /// + /// + /// This annotation takes two comma-separated arguments: first the literal name of the member VB_Attribute, then the value of that attribute. + /// /// - /// It is disjoint from ModuleAttributeAnnotation because of annotation scoping shenanigans. + /// The @MemberAttribute annotation cannot be used at module level. This separate annotation disambiguates any potential scoping issues that present themselves when the same name is used for both scopes. + /// This annotation may be used with module variable targets. /// - // marked as Variable annotation to accomodate annotations of constants + /// + /// + /// + /// + /// public class MemberAttributeAnnotation : FlexibleAttributeAnnotationBase { public MemberAttributeAnnotation() diff --git a/Rubberduck.Parsing/Annotations/Concrete/ModuleAttributeAnnotation.cs b/Rubberduck.Parsing/Annotations/Concrete/ModuleAttributeAnnotation.cs index 55b44a5397..baf7eb3f23 100644 --- a/Rubberduck.Parsing/Annotations/Concrete/ModuleAttributeAnnotation.cs +++ b/Rubberduck.Parsing/Annotations/Concrete/ModuleAttributeAnnotation.cs @@ -5,8 +5,22 @@ namespace Rubberduck.Parsing.Annotations { /// - /// This annotation allows specifying arbitrary VB_Attribute entries. + /// @ModuleAttribute annotation, allows specifying arbitrary VB_Attribute for modules. Use the quick-fixes to "Rubberduck Opportunities" code inspections to synchronize annotations and attributes. /// + /// + /// This annotation takes the literal name of the member VB_Attribute, then the comma-separated values of that attribute. + /// + /// + /// + /// + /// + /// public class ModuleAttributeAnnotation : FlexibleAttributeAnnotationBase { public ModuleAttributeAnnotation() diff --git a/Rubberduck.Parsing/Annotations/Concrete/ModuleCleanupAnnotation.cs b/Rubberduck.Parsing/Annotations/Concrete/ModuleCleanupAnnotation.cs index d433b4d162..9b508588fd 100644 --- a/Rubberduck.Parsing/Annotations/Concrete/ModuleCleanupAnnotation.cs +++ b/Rubberduck.Parsing/Annotations/Concrete/ModuleCleanupAnnotation.cs @@ -1,8 +1,26 @@ namespace Rubberduck.Parsing.Annotations { /// - /// Marks a method that the test engine will execute after all unit tests in a test module have executed. + /// @ModuleCleanup annotation, marks a procedure that the unit testing engine executes after all tests of a module have completed. /// + /// + /// This annotation takes no argument. + /// + /// + /// + /// + /// + /// public sealed class ModuleCleanupAnnotation : AnnotationBase, ITestAnnotation { public ModuleCleanupAnnotation() diff --git a/Rubberduck.Parsing/Annotations/Concrete/ModuleDescriptionAnnotation.cs b/Rubberduck.Parsing/Annotations/Concrete/ModuleDescriptionAnnotation.cs index d44c0702ca..d218d18041 100644 --- a/Rubberduck.Parsing/Annotations/Concrete/ModuleDescriptionAnnotation.cs +++ b/Rubberduck.Parsing/Annotations/Concrete/ModuleDescriptionAnnotation.cs @@ -5,11 +5,25 @@ namespace Rubberduck.Parsing.Annotations { /// - /// Used for specifying a module's VB_Description attribute. + /// @ModuleDescription annotation, uses the VB_Description module attribute to provide a docstring for a module. Use the quick-fixes to "Rubberduck Opportunities" code inspections to synchronize annotations and attributes. /// + /// + /// 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 module attribute. + /// /// - /// This is a class distinct from Member and Variable descriptions, because annotation scoping is annoyingly complicated and Rubberduck has a much easier time if module annotations and member annotations don't have the same name. + /// The @Description annotation cannot be used at module level. This separate annotation disambiguates any potential scoping issues that present themselves when the same name is used for both scopes. /// + /// + /// + /// + /// + /// public sealed class ModuleDescriptionAnnotation : DescriptionAttributeAnnotationBase { public ModuleDescriptionAnnotation() diff --git a/Rubberduck.Parsing/Annotations/Concrete/ModuleInitializeAnnotation.cs b/Rubberduck.Parsing/Annotations/Concrete/ModuleInitializeAnnotation.cs index 2a6ed07564..dfa3004b01 100644 --- a/Rubberduck.Parsing/Annotations/Concrete/ModuleInitializeAnnotation.cs +++ b/Rubberduck.Parsing/Annotations/Concrete/ModuleInitializeAnnotation.cs @@ -1,8 +1,26 @@ namespace Rubberduck.Parsing.Annotations { /// - /// Marks a method that the test engine will execute before executing the first unit test in a test module. + /// @ModuleInitialize annotation, marks a procedure that the unit testing engine executes before running the first test of a module. /// + /// + /// This annotation takes no argument. + /// + /// + /// + /// + /// + /// public sealed class ModuleInitializeAnnotation : AnnotationBase, ITestAnnotation { public ModuleInitializeAnnotation() diff --git a/Rubberduck.Parsing/Annotations/Concrete/NoIndentAnnotation.cs b/Rubberduck.Parsing/Annotations/Concrete/NoIndentAnnotation.cs index 516005a4a6..843dd2c987 100644 --- a/Rubberduck.Parsing/Annotations/Concrete/NoIndentAnnotation.cs +++ b/Rubberduck.Parsing/Annotations/Concrete/NoIndentAnnotation.cs @@ -1,8 +1,22 @@ namespace Rubberduck.Parsing.Annotations { /// - /// Marks a module that Smart Indenter ignores. + /// @NoIndent annotation, used by the "indent project" feature to ignore/skip particular modules when bulk-indenting. /// + /// + /// This annotation takes no argument. + /// + /// + /// + /// + /// + /// public sealed class NoIndentAnnotation : AnnotationBase { public NoIndentAnnotation() diff --git a/Rubberduck.Parsing/Annotations/Concrete/ObsoleteAnnotation.cs b/Rubberduck.Parsing/Annotations/Concrete/ObsoleteAnnotation.cs index d029d2234a..0461faf793 100644 --- a/Rubberduck.Parsing/Annotations/Concrete/ObsoleteAnnotation.cs +++ b/Rubberduck.Parsing/Annotations/Concrete/ObsoleteAnnotation.cs @@ -5,8 +5,25 @@ namespace Rubberduck.Parsing.Annotations { /// - /// Used to mark members as obsolete, so that Rubberduck can warn users whenever they try to use an obsolete member. + /// @Obsolete annotation, marks a procedure as "obsolete". Rubberduck inspections can then warn about code that references them. /// + /// + /// This annotation takes no argument. + /// + /// + /// + /// + /// + /// public sealed class ObsoleteAnnotation : AnnotationBase { public string ReplacementDocumentation { get; private set; } diff --git a/Rubberduck.Parsing/Annotations/Concrete/PredeclaredIdAnnotation.cs b/Rubberduck.Parsing/Annotations/Concrete/PredeclaredIdAnnotation.cs index 4216718479..69e79582b3 100644 --- a/Rubberduck.Parsing/Annotations/Concrete/PredeclaredIdAnnotation.cs +++ b/Rubberduck.Parsing/Annotations/Concrete/PredeclaredIdAnnotation.cs @@ -5,8 +5,26 @@ namespace Rubberduck.Parsing.Annotations { /// - /// Used for specifying a module's VB_PredeclaredId attribute. + /// @PredeclaredId annotation, uses the VB_Predeclared module attribute to define a compile-time default instance for the class. Use the quick-fixes to "Rubberduck Opportunities" code inspections to synchronize annotations and attributes. /// + /// + /// This annotation takes no argument. + /// + /// + /// Consider keeping the default/predeclared instance stateless. + /// + /// + /// + /// + /// + /// public sealed class PredeclaredIdAnnotation : FixedAttributeValueAnnotationBase { public PredeclaredIdAnnotation() diff --git a/Rubberduck.Parsing/Annotations/Concrete/TestCleanupAnnotation.cs b/Rubberduck.Parsing/Annotations/Concrete/TestCleanupAnnotation.cs index d99184cf9a..dda0bd4ab8 100644 --- a/Rubberduck.Parsing/Annotations/Concrete/TestCleanupAnnotation.cs +++ b/Rubberduck.Parsing/Annotations/Concrete/TestCleanupAnnotation.cs @@ -1,8 +1,27 @@ namespace Rubberduck.Parsing.Annotations { /// - /// Marks a method that the test engine will execute after executing each unit test in a test module. + /// @TestCleanup annotation, marks a procedure that the unit testing engine executes once after running each of the tests in a module. /// + /// + /// This annotation takes no argument. + /// + /// + /// + /// + /// + /// public sealed class TestCleanupAnnotation : AnnotationBase, ITestAnnotation { public TestCleanupAnnotation() diff --git a/Rubberduck.Parsing/Annotations/Concrete/TestInitializeAnnotation.cs b/Rubberduck.Parsing/Annotations/Concrete/TestInitializeAnnotation.cs index b028245dc5..4ef62bf122 100644 --- a/Rubberduck.Parsing/Annotations/Concrete/TestInitializeAnnotation.cs +++ b/Rubberduck.Parsing/Annotations/Concrete/TestInitializeAnnotation.cs @@ -1,8 +1,27 @@ namespace Rubberduck.Parsing.Annotations { /// - /// Marks a method that the test engine will execute before executing each unit test in a test module. + /// @TestInitialize annotation, marks a procedure that the unit testing engine executes once before running each of the tests in a module. /// + /// + /// This annotation takes no argument. + /// + /// + /// + /// + /// + /// public sealed class TestInitializeAnnotation : AnnotationBase, ITestAnnotation { public TestInitializeAnnotation() diff --git a/Rubberduck.Parsing/Annotations/Concrete/TestMethodAnnotation.cs b/Rubberduck.Parsing/Annotations/Concrete/TestMethodAnnotation.cs index 4d83fa8cd5..b9fc660566 100644 --- a/Rubberduck.Parsing/Annotations/Concrete/TestMethodAnnotation.cs +++ b/Rubberduck.Parsing/Annotations/Concrete/TestMethodAnnotation.cs @@ -5,8 +5,28 @@ namespace Rubberduck.Parsing.Annotations { /// - /// Marks a method that the test engine will execute as a unit test. + /// @TestMethod annotation, identifies procedures that contain unit tests. /// + /// + /// This annotation takes an optional string argument identifying the test category. + /// + /// + /// + /// + /// + /// public sealed class TestMethodAnnotation : AnnotationBase, ITestAnnotation { public TestMethodAnnotation() diff --git a/Rubberduck.Parsing/Annotations/Concrete/TestModuleAnnotation.cs b/Rubberduck.Parsing/Annotations/Concrete/TestModuleAnnotation.cs index fb89d38349..9c950fc3c8 100644 --- a/Rubberduck.Parsing/Annotations/Concrete/TestModuleAnnotation.cs +++ b/Rubberduck.Parsing/Annotations/Concrete/TestModuleAnnotation.cs @@ -1,11 +1,25 @@ namespace Rubberduck.Parsing.Annotations { /// - /// Marks a module that the test engine treat as a test module. + /// @TestModule annotation, marks a module for unit test discovery. /// + /// + /// This annotation takes no argument. + /// /// - /// Unit test discovery only inspects modules with a @TestModule annotation. + /// The test engine only scans modules with this annotation when discovering unit tests. /// + /// + /// + /// + /// + /// public sealed class TestModuleAnnotation : AnnotationBase { public TestModuleAnnotation() diff --git a/Rubberduck.Parsing/Annotations/Concrete/VariableDescriptionAnnotation.cs b/Rubberduck.Parsing/Annotations/Concrete/VariableDescriptionAnnotation.cs index 7d4297dff6..3f6ebebf01 100644 --- a/Rubberduck.Parsing/Annotations/Concrete/VariableDescriptionAnnotation.cs +++ b/Rubberduck.Parsing/Annotations/Concrete/VariableDescriptionAnnotation.cs @@ -4,6 +4,28 @@ namespace Rubberduck.Parsing.Annotations { + /// + /// @VariableDescription annotation, uses the VB_VarDescription attribute to provide a docstring for a module-level variable or constant. Use the quick-fixes to "Rubberduck Opportunities" code inspections to synchronize annotations and attributes. + /// + /// + /// This annotation takes no argument. + /// + /// + /// The @Description annotation cannot be used at the module variable level. This separate annotation disambiguates any potential scoping issues that present themselves when the same name is used for both scopes. + /// + /// + /// + /// + /// + /// public class VariableDescriptionAnnotation : DescriptionAttributeAnnotationBase { public VariableDescriptionAnnotation() From dbb93c3cbbfee9a70c29e2f25c3ce9171c41bb76 Mon Sep 17 00:00:00 2001 From: Mathieu Guindon Date: Sun, 26 Apr 2020 19:33:22 -0400 Subject: [PATCH 06/30] Added Rubberduck.Parsing.xml build artifact --- appveyor.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/appveyor.yml b/appveyor.yml index 22b93a5d3f..3ba5887552 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -120,6 +120,8 @@ artifacts: name: Rubberduck - path: Rubberduck.Deployment\bin\Rubberduck.CodeAnalysis.xml name: InspectionDocs + - path: Rubberduck.Deployment\bin\Rubberduck.Parsing.xml + name: AnnotationDocs - path: Rubberduck.Deployment\InnoSetup\Installers\*.hash name: InstallerHashes - path: Rubberduck_Coverage.xml @@ -135,7 +137,7 @@ deploy: description: "Built with :heart: by AppVeyor CI on [$(appveyor_repo_branch)] - https://ci.appveyor.com/project/rubberduck-vba/rubberduck/build/$(appveyor_build_version)" auth_token: secure: NVAZgFRSk566SP5QDge5gYRWCaLi4NJJPTNk3QengH15wL9iVldfrFOllbzKXExq - artifact: Rubberduck, InspectionDocs, InstallerHashes + artifact: Rubberduck, InspectionDocs, AnnotationDocs, InstallerHashes on: branch: master - provider: GitHub @@ -146,7 +148,7 @@ deploy: description: "AppVeyor build on [$(appveyor_repo_branch)] - https://ci.appveyor.com/project/rubberduck-vba/rubberduck/build/$(appveyor_build_version)" auth_token: secure: NVAZgFRSk566SP5QDge5gYRWCaLi4NJJPTNk3QengH15wL9iVldfrFOllbzKXExq - artifact: Rubberduck, InspectionDocs, InstallerHashes + artifact: Rubberduck, InspectionDocs, AnnotationDocs, InstallerHashes on: branch: next From 7524a7b1943758bb56987e1f190d359363e0979d Mon Sep 17 00:00:00 2001 From: Mathieu Guindon Date: Sun, 26 Apr 2020 19:43:21 -0400 Subject: [PATCH 07/30] updated parameter docs --- .../Annotations/Concrete/DefaultMemberAnnotation.cs | 3 --- .../Annotations/Concrete/DescriptionAnnotation.cs | 7 +++++-- .../Annotations/Concrete/EnumeratorMemberAnnotation.cs | 3 --- .../Annotations/Concrete/ExcelHotKeyAnnotation.cs | 4 ++-- .../Annotations/Concrete/ExposedModuleAnnotation.cs | 3 --- .../Annotations/Concrete/FolderAnnotation.cs | 4 ++-- .../Annotations/Concrete/IgnoreAnnotation.cs | 4 ++-- .../Annotations/Concrete/IgnoreModuleAnnotation.cs | 2 +- .../Annotations/Concrete/IgnoreTestAnnotation.cs | 3 --- .../Annotations/Concrete/InterfaceAnnotation.cs | 3 --- .../Annotations/Concrete/MemberAttributeAnnotation.cs | 7 +++++-- .../Annotations/Concrete/ModuleAttributeAnnotation.cs | 7 +++++-- .../Annotations/Concrete/ModuleCleanupAnnotation.cs | 3 --- .../Annotations/Concrete/ModuleDescriptionAnnotation.cs | 5 +++-- .../Annotations/Concrete/ModuleInitializeAnnotation.cs | 3 --- .../Annotations/Concrete/NoIndentAnnotation.cs | 3 --- .../Annotations/Concrete/ObsoleteAnnotation.cs | 4 ++-- .../Annotations/Concrete/PredeclaredIdAnnotation.cs | 3 --- .../Annotations/Concrete/TestCleanupAnnotation.cs | 3 --- .../Annotations/Concrete/TestInitializeAnnotation.cs | 3 --- .../Annotations/Concrete/TestMethodAnnotation.cs | 4 ++-- .../Annotations/Concrete/TestModuleAnnotation.cs | 3 --- .../Annotations/Concrete/VariableDescriptionAnnotation.cs | 3 --- 23 files changed, 29 insertions(+), 58 deletions(-) diff --git a/Rubberduck.Parsing/Annotations/Concrete/DefaultMemberAnnotation.cs b/Rubberduck.Parsing/Annotations/Concrete/DefaultMemberAnnotation.cs index f478ccc7e1..0469bdc507 100644 --- a/Rubberduck.Parsing/Annotations/Concrete/DefaultMemberAnnotation.cs +++ b/Rubberduck.Parsing/Annotations/Concrete/DefaultMemberAnnotation.cs @@ -9,9 +9,6 @@ namespace Rubberduck.Parsing.Annotations /// /// @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. /// - /// - /// This annotation takes no argument. - /// /// /// /// /// @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. /// - /// - /// 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. + /// + /// This string literal parameter does not support expressions and/or multiline inputs. The string literal is used as-is as the value of the hidden member attribute. /// + /// + /// This documentation string appears in the VBE's own Object Browser, as well as in various Rubberduck UI elements. + /// /// /// /// /// @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. /// - /// - /// This annotation takes no argument. - /// /// /// /// /// @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. /// - /// - /// 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! + /// + /// A single-letter string argument maps 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! /// /// /// diff --git a/Rubberduck.Parsing/Annotations/Concrete/ExposedModuleAnnotation.cs b/Rubberduck.Parsing/Annotations/Concrete/ExposedModuleAnnotation.cs index 924a3fd9de..a3c572558d 100644 --- a/Rubberduck.Parsing/Annotations/Concrete/ExposedModuleAnnotation.cs +++ b/Rubberduck.Parsing/Annotations/Concrete/ExposedModuleAnnotation.cs @@ -7,9 +7,6 @@ namespace Rubberduck.Parsing.Annotations /// /// @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. /// - /// - /// This annotation takes no argument. - /// /// /// /// /// @Folder annotation, determines where in a custom folder structure a given module appears in the Code Explorer toolwindow. /// - /// - /// 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. + /// + /// This string literal argument uses the dot "." character to indicate parent/child folders. Consider using folder names that are valid in the file system; PascalCase names are ideal. /// /// /// diff --git a/Rubberduck.Parsing/Annotations/Concrete/IgnoreAnnotation.cs b/Rubberduck.Parsing/Annotations/Concrete/IgnoreAnnotation.cs index 34b8c86d63..0d9b9dbbb6 100644 --- a/Rubberduck.Parsing/Annotations/Concrete/IgnoreAnnotation.cs +++ b/Rubberduck.Parsing/Annotations/Concrete/IgnoreAnnotation.cs @@ -3,8 +3,8 @@ /// /// @Ignore annotation, used for ignoring inspection results at member and local level. /// - /// - /// 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. + /// + /// This annotation optionally takes a comma-separated list of inspection names as argument. If no specific inspection is provided, then all inspections should ignore the annotated target. /// /// /// Use the @IgnoreModule annotation to annotate at module level. diff --git a/Rubberduck.Parsing/Annotations/Concrete/IgnoreModuleAnnotation.cs b/Rubberduck.Parsing/Annotations/Concrete/IgnoreModuleAnnotation.cs index 6ab8eee7df..2d01a3e502 100644 --- a/Rubberduck.Parsing/Annotations/Concrete/IgnoreModuleAnnotation.cs +++ b/Rubberduck.Parsing/Annotations/Concrete/IgnoreModuleAnnotation.cs @@ -3,7 +3,7 @@ /// /// @IgnoreModule annotation, used for ignoring inspection results module-wide. /// - /// + /// /// 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. /// /// diff --git a/Rubberduck.Parsing/Annotations/Concrete/IgnoreTestAnnotation.cs b/Rubberduck.Parsing/Annotations/Concrete/IgnoreTestAnnotation.cs index 1b5cf8d4b6..8591605556 100644 --- a/Rubberduck.Parsing/Annotations/Concrete/IgnoreTestAnnotation.cs +++ b/Rubberduck.Parsing/Annotations/Concrete/IgnoreTestAnnotation.cs @@ -3,9 +3,6 @@ /// /// @IgnoreTest annotation, used for ignoring a particular unit test in a test module. /// - /// - /// This annotation takes no argument. - /// /// /// Test Explorer will skip tests decorated with this annotation. /// diff --git a/Rubberduck.Parsing/Annotations/Concrete/InterfaceAnnotation.cs b/Rubberduck.Parsing/Annotations/Concrete/InterfaceAnnotation.cs index 04c5e3b6e2..25ea8517ec 100644 --- a/Rubberduck.Parsing/Annotations/Concrete/InterfaceAnnotation.cs +++ b/Rubberduck.Parsing/Annotations/Concrete/InterfaceAnnotation.cs @@ -3,9 +3,6 @@ /// /// @Interface annotation, marks a class as an abstract interface; Rubberduck can use this valuable metadata in its code analysis. /// - /// - /// This annotation takes no argument. - /// /// /// Code Explorer uses an "interface" icon to represent class modules with this annotation. /// diff --git a/Rubberduck.Parsing/Annotations/Concrete/MemberAttributeAnnotation.cs b/Rubberduck.Parsing/Annotations/Concrete/MemberAttributeAnnotation.cs index eab209b826..2f787e4700 100644 --- a/Rubberduck.Parsing/Annotations/Concrete/MemberAttributeAnnotation.cs +++ b/Rubberduck.Parsing/Annotations/Concrete/MemberAttributeAnnotation.cs @@ -7,8 +7,11 @@ namespace Rubberduck.Parsing.Annotations /// /// @MemberAttribute annotation, allows specifying arbitrary VB_Attribute for members. Use the quick-fixes to "Rubberduck Opportunities" code inspections to synchronize annotations and attributes. /// - /// - /// This annotation takes two comma-separated arguments: first the literal name of the member VB_Attribute, then the value of that attribute. + /// + /// The literal identifier name of the member VB_Attribute. + /// + /// + /// The comma-separated attribute values, as applicable. /// /// /// The @MemberAttribute annotation cannot be used at module level. This separate annotation disambiguates any potential scoping issues that present themselves when the same name is used for both scopes. diff --git a/Rubberduck.Parsing/Annotations/Concrete/ModuleAttributeAnnotation.cs b/Rubberduck.Parsing/Annotations/Concrete/ModuleAttributeAnnotation.cs index baf7eb3f23..564f946e55 100644 --- a/Rubberduck.Parsing/Annotations/Concrete/ModuleAttributeAnnotation.cs +++ b/Rubberduck.Parsing/Annotations/Concrete/ModuleAttributeAnnotation.cs @@ -7,8 +7,11 @@ namespace Rubberduck.Parsing.Annotations /// /// @ModuleAttribute annotation, allows specifying arbitrary VB_Attribute for modules. Use the quick-fixes to "Rubberduck Opportunities" code inspections to synchronize annotations and attributes. /// - /// - /// This annotation takes the literal name of the member VB_Attribute, then the comma-separated values of that attribute. + /// + /// The literal identifier name of the member VB_Attribute. + /// + /// + /// The comma-separated attribute values, as applicable. /// /// /// diff --git a/Rubberduck.Parsing/Annotations/Concrete/ModuleCleanupAnnotation.cs b/Rubberduck.Parsing/Annotations/Concrete/ModuleCleanupAnnotation.cs index 9b508588fd..8e5267e155 100644 --- a/Rubberduck.Parsing/Annotations/Concrete/ModuleCleanupAnnotation.cs +++ b/Rubberduck.Parsing/Annotations/Concrete/ModuleCleanupAnnotation.cs @@ -3,9 +3,6 @@ /// /// @ModuleCleanup annotation, marks a procedure that the unit testing engine executes after all tests of a module have completed. /// - /// - /// This annotation takes no argument. - /// /// /// /// /// @ModuleDescription annotation, uses the VB_Description module attribute to provide a docstring for a module. Use the quick-fixes to "Rubberduck Opportunities" code inspections to synchronize annotations and attributes. /// - /// - /// 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 module attribute. + /// + /// This string literal parameter does not support expressions and/or multiline inputs. The string literal is used as-is as the value of the hidden member attribute. /// /// /// The @Description annotation cannot be used at module level. This separate annotation disambiguates any potential scoping issues that present themselves when the same name is used for both scopes. + /// This documentation string appears in the VBE's own Object Browser, as well as in various Rubberduck UI elements. /// /// /// diff --git a/Rubberduck.Parsing/Annotations/Concrete/ModuleInitializeAnnotation.cs b/Rubberduck.Parsing/Annotations/Concrete/ModuleInitializeAnnotation.cs index dfa3004b01..00f7956f70 100644 --- a/Rubberduck.Parsing/Annotations/Concrete/ModuleInitializeAnnotation.cs +++ b/Rubberduck.Parsing/Annotations/Concrete/ModuleInitializeAnnotation.cs @@ -3,9 +3,6 @@ /// /// @ModuleInitialize annotation, marks a procedure that the unit testing engine executes before running the first test of a module. /// - /// - /// This annotation takes no argument. - /// /// /// /// /// @NoIndent annotation, used by the "indent project" feature to ignore/skip particular modules when bulk-indenting. /// - /// - /// This annotation takes no argument. - /// /// /// /// /// @Obsolete annotation, marks a procedure as "obsolete". Rubberduck inspections can then warn about code that references them. /// - /// - /// This annotation takes no argument. + /// + /// If provided, the first argument becomes additional metadata that Rubberduck can use in inspection results, for example. /// /// /// diff --git a/Rubberduck.Parsing/Annotations/Concrete/PredeclaredIdAnnotation.cs b/Rubberduck.Parsing/Annotations/Concrete/PredeclaredIdAnnotation.cs index 69e79582b3..addaa55867 100644 --- a/Rubberduck.Parsing/Annotations/Concrete/PredeclaredIdAnnotation.cs +++ b/Rubberduck.Parsing/Annotations/Concrete/PredeclaredIdAnnotation.cs @@ -7,9 +7,6 @@ namespace Rubberduck.Parsing.Annotations /// /// @PredeclaredId annotation, uses the VB_Predeclared module attribute to define a compile-time default instance for the class. Use the quick-fixes to "Rubberduck Opportunities" code inspections to synchronize annotations and attributes. /// - /// - /// This annotation takes no argument. - /// /// /// Consider keeping the default/predeclared instance stateless. /// diff --git a/Rubberduck.Parsing/Annotations/Concrete/TestCleanupAnnotation.cs b/Rubberduck.Parsing/Annotations/Concrete/TestCleanupAnnotation.cs index dda0bd4ab8..362332f087 100644 --- a/Rubberduck.Parsing/Annotations/Concrete/TestCleanupAnnotation.cs +++ b/Rubberduck.Parsing/Annotations/Concrete/TestCleanupAnnotation.cs @@ -3,9 +3,6 @@ /// /// @TestCleanup annotation, marks a procedure that the unit testing engine executes once after running each of the tests in a module. /// - /// - /// This annotation takes no argument. - /// /// /// /// /// @TestInitialize annotation, marks a procedure that the unit testing engine executes once before running each of the tests in a module. /// - /// - /// This annotation takes no argument. - /// /// /// /// /// @TestMethod annotation, identifies procedures that contain unit tests. /// - /// - /// This annotation takes an optional string argument identifying the test category. + /// + /// If arguments are supplied, the current implementation makes the first provided argument be the test category. /// /// /// diff --git a/Rubberduck.Parsing/Annotations/Concrete/TestModuleAnnotation.cs b/Rubberduck.Parsing/Annotations/Concrete/TestModuleAnnotation.cs index 9c950fc3c8..913aeebf34 100644 --- a/Rubberduck.Parsing/Annotations/Concrete/TestModuleAnnotation.cs +++ b/Rubberduck.Parsing/Annotations/Concrete/TestModuleAnnotation.cs @@ -3,9 +3,6 @@ /// /// @TestModule annotation, marks a module for unit test discovery. /// - /// - /// This annotation takes no argument. - /// /// /// The test engine only scans modules with this annotation when discovering unit tests. /// diff --git a/Rubberduck.Parsing/Annotations/Concrete/VariableDescriptionAnnotation.cs b/Rubberduck.Parsing/Annotations/Concrete/VariableDescriptionAnnotation.cs index 3f6ebebf01..bd507b2aad 100644 --- a/Rubberduck.Parsing/Annotations/Concrete/VariableDescriptionAnnotation.cs +++ b/Rubberduck.Parsing/Annotations/Concrete/VariableDescriptionAnnotation.cs @@ -7,9 +7,6 @@ namespace Rubberduck.Parsing.Annotations /// /// @VariableDescription annotation, uses the VB_VarDescription attribute to provide a docstring for a module-level variable or constant. Use the quick-fixes to "Rubberduck Opportunities" code inspections to synchronize annotations and attributes. /// - /// - /// This annotation takes no argument. - /// /// /// The @Description annotation cannot be used at the module variable level. This separate annotation disambiguates any potential scoping issues that present themselves when the same name is used for both scopes. /// From 37a6e723aee540326411e9d870ea8158731f7c4e Mon Sep 17 00:00:00 2001 From: Mathieu Guindon Date: Sun, 26 Apr 2020 19:57:30 -0400 Subject: [PATCH 08/30] fix output path --- Rubberduck.Parsing/Rubberduck.Parsing.csproj | 1 + 1 file changed, 1 insertion(+) diff --git a/Rubberduck.Parsing/Rubberduck.Parsing.csproj b/Rubberduck.Parsing/Rubberduck.Parsing.csproj index 60928e3314..6dc19b6e55 100644 --- a/Rubberduck.Parsing/Rubberduck.Parsing.csproj +++ b/Rubberduck.Parsing/Rubberduck.Parsing.csproj @@ -14,6 +14,7 @@ true 1701;1702;1591;4011;1001;7035;1053 Rubberduck.Parsing.xml + True From 79691620717258b2b5a269427efcf21aedfa22f4 Mon Sep 17 00:00:00 2001 From: Mathieu Guindon Date: Mon, 27 Apr 2020 11:45:27 -0400 Subject: [PATCH 09/30] generate Rubberduck.Parsing.xml in unified build output path --- .gitignore | 1 + .../Rubberduck.CodeAnalysis.csproj | 1 + Rubberduck.Parsing/Rubberduck.Parsing.csproj | 15 +++++++++------ 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index b9dcb4246d..418e55ca00 100644 --- a/.gitignore +++ b/.gitignore @@ -190,3 +190,4 @@ Rubberduck.CodeAnalysis.xml #Gradle /.gradle/ /Rubberduck.CodeAnalysis/Rubberduck.CodeAnalysis.xml +/Rubberduck.Parsing/Rubberduck.Parsing.xml diff --git a/Rubberduck.CodeAnalysis/Rubberduck.CodeAnalysis.csproj b/Rubberduck.CodeAnalysis/Rubberduck.CodeAnalysis.csproj index 0ed59ed71c..e42e51303b 100644 --- a/Rubberduck.CodeAnalysis/Rubberduck.CodeAnalysis.csproj +++ b/Rubberduck.CodeAnalysis/Rubberduck.CodeAnalysis.csproj @@ -5,6 +5,7 @@ Assembly Containing the Code Analysis features exposed by Rubberduck Copyright © 2017-2019 Rubberduck.CodeAnalysis + Rubberduck.CodeAnalysis Rubberduck.CodeAnalysis {DEF2FB9D-6E62-49D6-8E26-9983AC025768} diff --git a/Rubberduck.Parsing/Rubberduck.Parsing.csproj b/Rubberduck.Parsing/Rubberduck.Parsing.csproj index 6dc19b6e55..9c72da8a80 100644 --- a/Rubberduck.Parsing/Rubberduck.Parsing.csproj +++ b/Rubberduck.Parsing/Rubberduck.Parsing.csproj @@ -1,21 +1,24 @@  - Rubberduck.Parsing - Rubberduck.Parsing Rubberduck.Parsing + This assembly contains the parts responsible for turning VBA code into tokens and parse trees. Copyright © 2015-2019 + Rubberduck.Parsing + Rubberduck.Parsing + Rubberduck.Parsing {A4A618E1-CBCA-435F-9C6C-5181E030ADFC} + true + + + Rubberduck.Parsing.xml - - 1 true 1701;1702;1591;4011;1001;7035;1053 - Rubberduck.Parsing.xml - + True From 2725c60c97e79386811b80fb10b3d9ee3d7a6ff9 Mon Sep 17 00:00:00 2001 From: Mathieu Guindon Date: Thu, 14 May 2020 03:15:55 -0400 Subject: [PATCH 10/30] removed illegal example --- .../Annotations/Concrete/IgnoreAnnotation.cs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/Rubberduck.Parsing/Annotations/Concrete/IgnoreAnnotation.cs b/Rubberduck.Parsing/Annotations/Concrete/IgnoreAnnotation.cs index 0d9b9dbbb6..0b693693d1 100644 --- a/Rubberduck.Parsing/Annotations/Concrete/IgnoreAnnotation.cs +++ b/Rubberduck.Parsing/Annotations/Concrete/IgnoreAnnotation.cs @@ -15,13 +15,8 @@ /// Option Explicit /// Private InternalState As VBA.Collection /// - /// '@Ignore - /// Public Sub DoSomething(ByRef foo As Long) - /// foo = 42 - /// End Sub - /// /// '@Ignore ProcedureNotUsed - /// Public Sub DoSomethingElse() + /// Public Sub DoSomething() /// '@Ignore VariableNotAssigned /// Dim result As Variant /// DoSomething result From 7b92efd06d87b77f1c045cef2e5471b4108fc0cb Mon Sep 17 00:00:00 2001 From: Max Doerner Date: Sun, 5 Jul 2020 18:08:48 +0200 Subject: [PATCH 11/30] Add/Align German translations Also aligns several endings in the English version. --- .../i18n/AssistantResources.de.resx | 6 +- Rubberduck.Resources/About/AboutUI.de.resx | 2 +- .../CodeExplorer/CodeExplorerUI.Designer.cs | 2 +- .../CodeExplorer/CodeExplorerUI.de.resx | 2 +- .../CodeExplorer/CodeExplorerUI.resx | 2 +- .../Inspections/QuickFixes.de.resx | 6 +- .../Menus/RubberduckMenus.de.resx | 2 +- .../Refactorings/Refactorings.de.resx | 5 +- .../RegexAssistant/RegexAssistantUI.de.resx | 6 +- Rubberduck.Resources/RubberduckUI.Designer.cs | 20 +++--- Rubberduck.Resources/RubberduckUI.de.resx | 68 +++++++++++++++---- Rubberduck.Resources/RubberduckUI.resx | 20 +++--- .../Settings/AutoCompletesPage.Designer.cs | 2 +- .../Settings/AutoCompletesPage.resx | 2 +- .../UnitTesting/TestExplorer.Designer.cs | 2 +- .../UnitTesting/TestExplorer.de.resx | 12 ++++ .../UnitTesting/TestExplorer.resx | 2 +- 17 files changed, 107 insertions(+), 54 deletions(-) diff --git a/Rubberduck.RegexAssistant/i18n/AssistantResources.de.resx b/Rubberduck.RegexAssistant/i18n/AssistantResources.de.resx index b73d169050..fc9a2bfcef 100644 --- a/Rubberduck.RegexAssistant/i18n/AssistantResources.de.resx +++ b/Rubberduck.RegexAssistant/i18n/AssistantResources.de.resx @@ -1,4 +1,4 @@ - +