diff --git a/Rubberduck.CodeAnalysis/Inspections/Concrete/ExcelUdfNameIsValidCellReferenceInspection.cs b/Rubberduck.CodeAnalysis/Inspections/Concrete/ExcelUdfNameIsValidCellReferenceInspection.cs new file mode 100644 index 0000000000..f23b890678 --- /dev/null +++ b/Rubberduck.CodeAnalysis/Inspections/Concrete/ExcelUdfNameIsValidCellReferenceInspection.cs @@ -0,0 +1,49 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text.RegularExpressions; +using Rubberduck.Inspections.Abstract; +using Rubberduck.Inspections.Results; +using Rubberduck.Parsing.Inspections; +using Rubberduck.Parsing.Inspections.Abstract; +using Rubberduck.Parsing.Symbols; +using Rubberduck.Parsing.VBA; +using Rubberduck.Resources.Inspections; + +namespace Rubberduck.Inspections.Inspections.Concrete +{ + [RequiredLibrary("Excel")] + public class ExcelUdfNameIsValidCellReferenceInspection : InspectionBase + { + public ExcelUdfNameIsValidCellReferenceInspection(RubberduckParserState state) : base(state) { } + + private static readonly Regex ValidCellIdRegex = + new Regex(@"^([a-z]|[a-z]{2}|[a-w][a-z]{2}|x([a-e][a-z]|f[a-d]))(?\d+)$", + RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.ExplicitCapture); + + private static readonly HashSet VisibleAsUdf = new HashSet { Accessibility.Public, Accessibility.Implicit }; + + private const uint MaximumExcelRows = 1048576; + + protected override IEnumerable DoGetInspectionResults() + { + var excel = State.DeclarationFinder.Projects.SingleOrDefault(item => !item.IsUserDefined && item.IdentifierName == "Excel"); + if (excel == null) + { + return Enumerable.Empty(); + } + + var candidates = UserDeclarations.OfType().Where(decl => + decl.ParentScopeDeclaration.DeclarationType == DeclarationType.ProceduralModule && + VisibleAsUdf.Contains(decl.Accessibility)); + + return (from function in candidates.Where(decl => ValidCellIdRegex.IsMatch(decl.IdentifierName)) + let row = Convert.ToUInt32(ValidCellIdRegex.Matches(function.IdentifierName)[0].Groups["Row"].Value) + where row > 0 && row <= MaximumExcelRows && !IsIgnoringInspectionResultFor(function, AnnotationName) + select new DeclarationInspectionResult(this, + string.Format(InspectionResults.ExcelUdfNameIsValidCellReferenceInspection, function.IdentifierName), + function)) + .Cast().ToList(); + } + } +} diff --git a/Rubberduck.CodeAnalysis/QuickFixes/RenameDeclarationQuickFix.cs b/Rubberduck.CodeAnalysis/QuickFixes/RenameDeclarationQuickFix.cs index 1b5a3e3c13..f2d6d2f70b 100644 --- a/Rubberduck.CodeAnalysis/QuickFixes/RenameDeclarationQuickFix.cs +++ b/Rubberduck.CodeAnalysis/QuickFixes/RenameDeclarationQuickFix.cs @@ -1,6 +1,7 @@ using System.Globalization; using Rubberduck.Inspections.Abstract; using Rubberduck.Inspections.Concrete; +using Rubberduck.Inspections.Inspections.Concrete; using Rubberduck.Interaction; using Rubberduck.Parsing.Inspections.Abstract; using Rubberduck.Parsing.Rewriter; @@ -20,7 +21,11 @@ public sealed class RenameDeclarationQuickFix : QuickFixBase private readonly IMessageBox _messageBox; public RenameDeclarationQuickFix(IVBE vbe, RubberduckParserState state, IMessageBox messageBox, IRewritingManager rewritingManager) - : base(typeof(HungarianNotationInspection), typeof(UseMeaningfulNameInspection), typeof(DefaultProjectNameInspection), typeof(UnderscoreInPublicClassModuleMemberInspection)) + : base(typeof(HungarianNotationInspection), + typeof(UseMeaningfulNameInspection), + typeof(DefaultProjectNameInspection), + typeof(UnderscoreInPublicClassModuleMemberInspection), + typeof(ExcelUdfNameIsValidCellReferenceInspection)) { _vbe = vbe; _state = state; diff --git a/Rubberduck.Core/Properties/Settings.Designer.cs b/Rubberduck.Core/Properties/Settings.Designer.cs index 6ea6de3918..505d1657b9 100644 --- a/Rubberduck.Core/Properties/Settings.Designer.cs +++ b/Rubberduck.Core/Properties/Settings.Designer.cs @@ -25,15 +25,16 @@ public static Settings Default { [global::System.Configuration.ApplicationScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute(@" - - R - true - true - false - true - CodePaneRefactorRenameCommand -")] + [global::System.Configuration.DefaultSettingValueAttribute(@" + + R + true + true + false + true + CodePaneRefactorRenameCommand + + ")] public global::Rubberduck.Settings.HotkeySetting DefaultHotkey_CodePaneRefactorRenameCommand { get { return ((global::Rubberduck.Settings.HotkeySetting)(this["DefaultHotkey_CodePaneRefactorRenameCommand"])); @@ -42,15 +43,16 @@ public static Settings Default { [global::System.Configuration.ApplicationScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute(@" - - F - true - true - false - true - RefactorEncapsulateFieldCommand -")] + [global::System.Configuration.DefaultSettingValueAttribute(@" + + F + true + true + false + true + RefactorEncapsulateFieldCommand + + ")] public global::Rubberduck.Settings.HotkeySetting DefaultHotkey_RefactorEncapsulateFieldCommand { get { return ((global::Rubberduck.Settings.HotkeySetting)(this["DefaultHotkey_RefactorEncapsulateFieldCommand"])); @@ -59,15 +61,16 @@ public static Settings Default { [global::System.Configuration.ApplicationScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute(@" - - M - true - true - false - true - RefactorExtractMethodCommand -")] + [global::System.Configuration.DefaultSettingValueAttribute(@" + + M + true + true + false + true + RefactorExtractMethodCommand + + ")] public global::Rubberduck.Settings.HotkeySetting DefaultHotkey_RefactorExtractMethodCommand { get { return ((global::Rubberduck.Settings.HotkeySetting)(this["DefaultHotkey_RefactorExtractMethodCommand"])); @@ -76,15 +79,16 @@ public static Settings Default { [global::System.Configuration.ApplicationScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute(@" - - C - true - true - false - true - RefactorMoveCloserToUsageCommand -")] + [global::System.Configuration.DefaultSettingValueAttribute(@" + + C + true + true + false + true + RefactorMoveCloserToUsageCommand + + ")] public global::Rubberduck.Settings.HotkeySetting DefaultHotkey_RefactorMoveCloserToUsageCommand { get { return ((global::Rubberduck.Settings.HotkeySetting)(this["DefaultHotkey_RefactorMoveCloserToUsageCommand"])); @@ -93,15 +97,16 @@ public static Settings Default { [global::System.Configuration.ApplicationScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute(@" - - R - true - false - false - true - CodeExplorerCommand -")] + [global::System.Configuration.DefaultSettingValueAttribute(@" + + R + true + false + false + true + CodeExplorerCommand + + ")] public global::Rubberduck.Settings.HotkeySetting DefaultHotkey_CodeExplorerCommand { get { return ((global::Rubberduck.Settings.HotkeySetting)(this["DefaultHotkey_CodeExplorerCommand"])); @@ -110,15 +115,16 @@ public static Settings Default { [global::System.Configuration.ApplicationScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute(@" - - E - true - true - false - true - ExportAllCommand -")] + [global::System.Configuration.DefaultSettingValueAttribute(@" + + E + true + true + false + true + ExportAllCommand + + ")] public global::Rubberduck.Settings.HotkeySetting DefaultHotkey_ExportAllCommand { get { return ((global::Rubberduck.Settings.HotkeySetting)(this["DefaultHotkey_ExportAllCommand"])); @@ -127,15 +133,16 @@ public static Settings Default { [global::System.Configuration.ApplicationScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute(@" - - T - true - false - false - true - FindSymbolCommand -")] + [global::System.Configuration.DefaultSettingValueAttribute(@" + + T + true + false + false + true + FindSymbolCommand + + ")] public global::Rubberduck.Settings.HotkeySetting DefaultHotkey_FindSymbolCommand { get { return ((global::Rubberduck.Settings.HotkeySetting)(this["DefaultHotkey_FindSymbolCommand"])); @@ -144,15 +151,16 @@ public static Settings Default { [global::System.Configuration.ApplicationScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute(@" - - M - true - false - false - true - IndentCurrentModuleCommand -")] + [global::System.Configuration.DefaultSettingValueAttribute(@" + + M + true + false + false + true + IndentCurrentModuleCommand + + ")] public global::Rubberduck.Settings.HotkeySetting DefaultHotkey_IndentCurrentModuleCommand { get { return ((global::Rubberduck.Settings.HotkeySetting)(this["DefaultHotkey_IndentCurrentModuleCommand"])); @@ -161,15 +169,16 @@ public static Settings Default { [global::System.Configuration.ApplicationScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute(@" - - P - true - false - false - true - IndentCurrentProcedureCommand -")] + [global::System.Configuration.DefaultSettingValueAttribute(@" + + P + true + false + false + true + IndentCurrentProcedureCommand + + ")] public global::Rubberduck.Settings.HotkeySetting DefaultHotkey_IndentCurrentProcedureCommand { get { return ((global::Rubberduck.Settings.HotkeySetting)(this["DefaultHotkey_IndentCurrentProcedureCommand"])); @@ -178,15 +187,16 @@ public static Settings Default { [global::System.Configuration.ApplicationScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute(@" - - I - true - true - false - true - InspectionResultsCommand -")] + [global::System.Configuration.DefaultSettingValueAttribute(@" + + I + true + true + false + true + InspectionResultsCommand + + ")] public global::Rubberduck.Settings.HotkeySetting DefaultHotkey_InspectionResultsCommand { get { return ((global::Rubberduck.Settings.HotkeySetting)(this["DefaultHotkey_InspectionResultsCommand"])); @@ -195,15 +205,16 @@ public static Settings Default { [global::System.Configuration.ApplicationScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute(@" - - ` - true - false - false - true - ReparseCommand -")] + [global::System.Configuration.DefaultSettingValueAttribute(@" + + ` + true + false + false + true + ReparseCommand + + ")] public global::Rubberduck.Settings.HotkeySetting DefaultHotkey_ReparseCommand { get { return ((global::Rubberduck.Settings.HotkeySetting)(this["DefaultHotkey_ReparseCommand"])); @@ -212,15 +223,16 @@ public static Settings Default { [global::System.Configuration.ApplicationScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute(@" - - T - true - true - false - true - TestExplorerCommand -")] + [global::System.Configuration.DefaultSettingValueAttribute(@" + + T + true + true + false + true + TestExplorerCommand + + ")] public global::Rubberduck.Settings.HotkeySetting DefaultHotkey_TestExplorerCommand { get { return ((global::Rubberduck.Settings.HotkeySetting)(this["DefaultHotkey_TestExplorerCommand"])); @@ -229,9 +241,8 @@ public static Settings Default { [global::System.Configuration.ApplicationScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("\r\n")] + [global::System.Configuration.DefaultSettingValueAttribute("\r\n \r\n ")] public global::Rubberduck.Settings.ToDoMarker ToDoMarker_ToDo { get { return ((global::Rubberduck.Settings.ToDoMarker)(this["ToDoMarker_ToDo"])); @@ -240,9 +251,8 @@ public static Settings Default { [global::System.Configuration.ApplicationScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("\r\n")] + [global::System.Configuration.DefaultSettingValueAttribute("\r\n \r\n ")] public global::Rubberduck.Settings.ToDoMarker ToDoMarker_Note { get { return ((global::Rubberduck.Settings.ToDoMarker)(this["ToDoMarker_Note"])); @@ -251,9 +261,8 @@ public static Settings Default { [global::System.Configuration.ApplicationScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("\r\n")] + [global::System.Configuration.DefaultSettingValueAttribute("\r\n \r\n ")] public global::Rubberduck.Settings.ToDoMarker ToDoMarker_Bug { get { return ((global::Rubberduck.Settings.ToDoMarker)(this["ToDoMarker_Bug"])); @@ -262,16 +271,17 @@ public static Settings Default { [global::System.Configuration.ApplicationScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute(@" - - false - false - false - false - true - false - false -")] + [global::System.Configuration.DefaultSettingValueAttribute(@" + + false + false + false + false + true + false + false + + ")] public global::Rubberduck.Settings.WindowSettings WindowSettings { get { return ((global::Rubberduck.Settings.WindowSettings)(this["WindowSettings"])); @@ -280,14 +290,15 @@ public static Settings Default { [global::System.Configuration.ApplicationScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute(@" - - LateBinding - StrictAssert - true - true - false -")] + [global::System.Configuration.DefaultSettingValueAttribute(@" + + LateBinding + StrictAssert + true + true + false + + ")] public global::Rubberduck.Settings.UnitTestSettings UnitTestSettings { get { return ((global::Rubberduck.Settings.UnitTestSettings)(this["UnitTestSettings"])); @@ -296,19 +307,20 @@ public static Settings Default { [global::System.Configuration.ApplicationScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute(@" - - - true - true - true - false - false - 10 - false - 0 - -")] + [global::System.Configuration.DefaultSettingValueAttribute(@" + + + true + true + true + false + false + 10 + false + 0 + + + ")] public global::Rubberduck.Settings.GeneralSettings GeneralSettings { get { return ((global::Rubberduck.Settings.GeneralSettings)(this["GeneralSettings"])); @@ -317,125 +329,137 @@ public static Settings Default { [global::System.Configuration.ApplicationScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("\r\n\r\n \r\n \r\n \r\n \r\n " + + " \r\n \r\n \r\n \r\n \r\n " + + " \r\n \r\n \r\n \r\n \r\n " + + " \r\n \r\n \r\n \r\n " + + " \r\n \r\n \r\n " + + " \r\n \r\n " + + " \r\n \r\n \r\n" + + " \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n <" + + "CodeInspection Name=\"EmptyForEachBlockInspection\" Severity=\"Warning\" InspectionT" + + "ype=\"MaintainabilityAndReadabilityIssues\" />\r\n \r\n \r\n \r\n \r\n <" + - "CodeInspection Name=\"UnhandledOnErrorResumeNextInspection\" Severity=\"Warning\" In" + - "spectionType=\"CodeQualityIssues\" />\r\n \r\n <" + - "CodeInspection Name=\"ImplicitByRefModifierInspection\" Severity=\"Hint\" Inspection" + - "Type=\"CodeQualityIssues\" />\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n <" + - "CodeInspection Name=\"ObjectVariableNotSetInspection\" Severity=\"Error\" Inspection" + - "Type=\"CodeQualityIssues\" />\r\n \r\n \r\n \r" + - "\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n true\r\n")] + ">\r\n \r\n " + + "\r\n \r\n \r\n \r\n " + + " \r\n \r\n \r" + + "\n \r\n \r\n " + + "\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n " + + " \r\n \r\n " + + " \r\n \r\n \r\n " + + " \r\n \r\n \r\n \r\n \r\n " + + " \r\n \r\n \r\n " + + " \r\n \r\n \r\n " + + " \r\n \r\n \r\n " + + " \r\n \r\n \r\n " + + " \r\n \r\n " + + " true\r\n " + + " \r\n ")] public global::Rubberduck.Settings.CodeInspectionSettings CodeInspectionSettings { get { return ((global::Rubberduck.Settings.CodeInspectionSettings)(this["CodeInspectionSettings"])); @@ -444,25 +468,16 @@ public static Settings Default { [global::System.Configuration.ApplicationScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n " + - " \r\n \r\n \r\n \r\n \r\n")] + [global::System.Configuration.DefaultSettingValueAttribute(@" + + + None + 25 + + + + + ")] public global::Rubberduck.Settings.AutoCompleteSettings AutoCompleteSettings { get { return ((global::Rubberduck.Settings.AutoCompleteSettings)(this["AutoCompleteSettings"])); diff --git a/Rubberduck.Core/Properties/Settings.settings b/Rubberduck.Core/Properties/Settings.settings index ac9d9c9fcb..3f2db75448 100644 --- a/Rubberduck.Core/Properties/Settings.settings +++ b/Rubberduck.Core/Properties/Settings.settings @@ -3,280 +3,301 @@ - <?xml version="1.0" encoding="utf-16"?> -<HotkeySetting xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> - <Key1>R</Key1> - <IsEnabled>true</IsEnabled> - <HasShiftModifier>true</HasShiftModifier> - <HasAltModifier>false</HasAltModifier> - <HasCtrlModifier>true</HasCtrlModifier> - <CommandTypeName>CodePaneRefactorRenameCommand</CommandTypeName> -</HotkeySetting> + + <HotkeySetting xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <Key1>R</Key1> + <IsEnabled>true</IsEnabled> + <HasShiftModifier>true</HasShiftModifier> + <HasAltModifier>false</HasAltModifier> + <HasCtrlModifier>true</HasCtrlModifier> + <CommandTypeName>CodePaneRefactorRenameCommand</CommandTypeName> + </HotkeySetting> + - <?xml version="1.0" encoding="utf-16"?> -<HotkeySetting xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> - <Key1>F</Key1> - <IsEnabled>true</IsEnabled> - <HasShiftModifier>true</HasShiftModifier> - <HasAltModifier>false</HasAltModifier> - <HasCtrlModifier>true</HasCtrlModifier> - <CommandTypeName>RefactorEncapsulateFieldCommand</CommandTypeName> -</HotkeySetting> + + <HotkeySetting xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <Key1>F</Key1> + <IsEnabled>true</IsEnabled> + <HasShiftModifier>true</HasShiftModifier> + <HasAltModifier>false</HasAltModifier> + <HasCtrlModifier>true</HasCtrlModifier> + <CommandTypeName>RefactorEncapsulateFieldCommand</CommandTypeName> + </HotkeySetting> + - <?xml version="1.0" encoding="utf-16"?> -<HotkeySetting xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> - <Key1>M</Key1> - <IsEnabled>true</IsEnabled> - <HasShiftModifier>true</HasShiftModifier> - <HasAltModifier>false</HasAltModifier> - <HasCtrlModifier>true</HasCtrlModifier> - <CommandTypeName>RefactorExtractMethodCommand</CommandTypeName> -</HotkeySetting> + + <HotkeySetting xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <Key1>M</Key1> + <IsEnabled>true</IsEnabled> + <HasShiftModifier>true</HasShiftModifier> + <HasAltModifier>false</HasAltModifier> + <HasCtrlModifier>true</HasCtrlModifier> + <CommandTypeName>RefactorExtractMethodCommand</CommandTypeName> + </HotkeySetting> + - <?xml version="1.0" encoding="utf-16"?> -<HotkeySetting xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> - <Key1>C</Key1> - <IsEnabled>true</IsEnabled> - <HasShiftModifier>true</HasShiftModifier> - <HasAltModifier>false</HasAltModifier> - <HasCtrlModifier>true</HasCtrlModifier> - <CommandTypeName>RefactorMoveCloserToUsageCommand</CommandTypeName> -</HotkeySetting> + + <HotkeySetting xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <Key1>C</Key1> + <IsEnabled>true</IsEnabled> + <HasShiftModifier>true</HasShiftModifier> + <HasAltModifier>false</HasAltModifier> + <HasCtrlModifier>true</HasCtrlModifier> + <CommandTypeName>RefactorMoveCloserToUsageCommand</CommandTypeName> + </HotkeySetting> + - <?xml version="1.0" encoding="utf-16"?> -<HotkeySetting xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> - <Key1>R</Key1> - <IsEnabled>true</IsEnabled> - <HasShiftModifier>false</HasShiftModifier> - <HasAltModifier>false</HasAltModifier> - <HasCtrlModifier>true</HasCtrlModifier> - <CommandTypeName>CodeExplorerCommand</CommandTypeName> -</HotkeySetting> + + <HotkeySetting xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <Key1>R</Key1> + <IsEnabled>true</IsEnabled> + <HasShiftModifier>false</HasShiftModifier> + <HasAltModifier>false</HasAltModifier> + <HasCtrlModifier>true</HasCtrlModifier> + <CommandTypeName>CodeExplorerCommand</CommandTypeName> + </HotkeySetting> + - <?xml version="1.0" encoding="utf-16"?> -<HotkeySetting xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> - <Key1>E</Key1> - <IsEnabled>true</IsEnabled> - <HasShiftModifier>true</HasShiftModifier> - <HasAltModifier>false</HasAltModifier> - <HasCtrlModifier>true</HasCtrlModifier> - <CommandTypeName>ExportAllCommand</CommandTypeName> -</HotkeySetting> + + <HotkeySetting xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <Key1>E</Key1> + <IsEnabled>true</IsEnabled> + <HasShiftModifier>true</HasShiftModifier> + <HasAltModifier>false</HasAltModifier> + <HasCtrlModifier>true</HasCtrlModifier> + <CommandTypeName>ExportAllCommand</CommandTypeName> + </HotkeySetting> + - <?xml version="1.0" encoding="utf-16"?> -<HotkeySetting xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> - <Key1>T</Key1> - <IsEnabled>true</IsEnabled> - <HasShiftModifier>false</HasShiftModifier> - <HasAltModifier>false</HasAltModifier> - <HasCtrlModifier>true</HasCtrlModifier> - <CommandTypeName>FindSymbolCommand</CommandTypeName> -</HotkeySetting> + + <HotkeySetting xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <Key1>T</Key1> + <IsEnabled>true</IsEnabled> + <HasShiftModifier>false</HasShiftModifier> + <HasAltModifier>false</HasAltModifier> + <HasCtrlModifier>true</HasCtrlModifier> + <CommandTypeName>FindSymbolCommand</CommandTypeName> + </HotkeySetting> + - <?xml version="1.0" encoding="utf-16"?> -<HotkeySetting xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> - <Key1>M</Key1> - <IsEnabled>true</IsEnabled> - <HasShiftModifier>false</HasShiftModifier> - <HasAltModifier>false</HasAltModifier> - <HasCtrlModifier>true</HasCtrlModifier> - <CommandTypeName>IndentCurrentModuleCommand</CommandTypeName> -</HotkeySetting> + + <HotkeySetting xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <Key1>M</Key1> + <IsEnabled>true</IsEnabled> + <HasShiftModifier>false</HasShiftModifier> + <HasAltModifier>false</HasAltModifier> + <HasCtrlModifier>true</HasCtrlModifier> + <CommandTypeName>IndentCurrentModuleCommand</CommandTypeName> + </HotkeySetting> + - <?xml version="1.0" encoding="utf-16"?> -<HotkeySetting xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> - <Key1>P</Key1> - <IsEnabled>true</IsEnabled> - <HasShiftModifier>false</HasShiftModifier> - <HasAltModifier>false</HasAltModifier> - <HasCtrlModifier>true</HasCtrlModifier> - <CommandTypeName>IndentCurrentProcedureCommand</CommandTypeName> -</HotkeySetting> + + <HotkeySetting xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <Key1>P</Key1> + <IsEnabled>true</IsEnabled> + <HasShiftModifier>false</HasShiftModifier> + <HasAltModifier>false</HasAltModifier> + <HasCtrlModifier>true</HasCtrlModifier> + <CommandTypeName>IndentCurrentProcedureCommand</CommandTypeName> + </HotkeySetting> + - <?xml version="1.0" encoding="utf-16"?> -<HotkeySetting xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> - <Key1>I</Key1> - <IsEnabled>true</IsEnabled> - <HasShiftModifier>true</HasShiftModifier> - <HasAltModifier>false</HasAltModifier> - <HasCtrlModifier>true</HasCtrlModifier> - <CommandTypeName>InspectionResultsCommand</CommandTypeName> -</HotkeySetting> + + <HotkeySetting xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <Key1>I</Key1> + <IsEnabled>true</IsEnabled> + <HasShiftModifier>true</HasShiftModifier> + <HasAltModifier>false</HasAltModifier> + <HasCtrlModifier>true</HasCtrlModifier> + <CommandTypeName>InspectionResultsCommand</CommandTypeName> + </HotkeySetting> + - <?xml version="1.0" encoding="utf-16"?> -<HotkeySetting xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> - <Key1>`</Key1> - <IsEnabled>true</IsEnabled> - <HasShiftModifier>false</HasShiftModifier> - <HasAltModifier>false</HasAltModifier> - <HasCtrlModifier>true</HasCtrlModifier> - <CommandTypeName>ReparseCommand</CommandTypeName> -</HotkeySetting> + + <HotkeySetting xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <Key1>`</Key1> + <IsEnabled>true</IsEnabled> + <HasShiftModifier>false</HasShiftModifier> + <HasAltModifier>false</HasAltModifier> + <HasCtrlModifier>true</HasCtrlModifier> + <CommandTypeName>ReparseCommand</CommandTypeName> + </HotkeySetting> + - <?xml version="1.0" encoding="utf-16"?> -<HotkeySetting xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> - <Key1>T</Key1> - <IsEnabled>true</IsEnabled> - <HasShiftModifier>true</HasShiftModifier> - <HasAltModifier>false</HasAltModifier> - <HasCtrlModifier>true</HasCtrlModifier> - <CommandTypeName>TestExplorerCommand</CommandTypeName> -</HotkeySetting> + + <HotkeySetting xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <Key1>T</Key1> + <IsEnabled>true</IsEnabled> + <HasShiftModifier>true</HasShiftModifier> + <HasAltModifier>false</HasAltModifier> + <HasCtrlModifier>true</HasCtrlModifier> + <CommandTypeName>TestExplorerCommand</CommandTypeName> + </HotkeySetting> + - <?xml version="1.0" encoding="utf-16"?> -<ToDoMarker xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Text="TODO" /> + + <ToDoMarker xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Text="TODO" /> + - <?xml version="1.0" encoding="utf-16"?> -<ToDoMarker xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Text="NOTE" /> + + <ToDoMarker xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Text="NOTE" /> + - <?xml version="1.0" encoding="utf-16"?> -<ToDoMarker xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Text="BUG" /> + + <ToDoMarker xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" Text="BUG" /> + - <?xml version="1.0" encoding="utf-16"?> -<WindowSettings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> - <CodeExplorerVisibleOnStartup>false</CodeExplorerVisibleOnStartup> - <CodeInspectionsVisibleOnStartup>false</CodeInspectionsVisibleOnStartup> - <TestExplorerVisibleOnStartup>false</TestExplorerVisibleOnStartup> - <TodoExplorerVisibleOnStartup>false</TodoExplorerVisibleOnStartup> - <CodeExplorer_SortByName>true</CodeExplorer_SortByName> - <CodeExplorer_SortByCodeOrder>false</CodeExplorer_SortByCodeOrder> - <CodeExplorer_GroupByType>false</CodeExplorer_GroupByType> -</WindowSettings> + + <WindowSettings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <CodeExplorerVisibleOnStartup>false</CodeExplorerVisibleOnStartup> + <CodeInspectionsVisibleOnStartup>false</CodeInspectionsVisibleOnStartup> + <TestExplorerVisibleOnStartup>false</TestExplorerVisibleOnStartup> + <TodoExplorerVisibleOnStartup>false</TodoExplorerVisibleOnStartup> + <CodeExplorer_SortByName>true</CodeExplorer_SortByName> + <CodeExplorer_SortByCodeOrder>false</CodeExplorer_SortByCodeOrder> + <CodeExplorer_GroupByType>false</CodeExplorer_GroupByType> + </WindowSettings> + - <?xml version="1.0" encoding="utf-16"?> -<UnitTestSettings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> - <BindingMode>LateBinding</BindingMode> - <AssertMode>StrictAssert</AssertMode> - <ModuleInit>true</ModuleInit> - <MethodInit>true</MethodInit> - <DefaultTestStubInNewModule>false</DefaultTestStubInNewModule> -</UnitTestSettings> + + <UnitTestSettings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <BindingMode>LateBinding</BindingMode> + <AssertMode>StrictAssert</AssertMode> + <ModuleInit>true</ModuleInit> + <MethodInit>true</MethodInit> + <DefaultTestStubInNewModule>false</DefaultTestStubInNewModule> + </UnitTestSettings> + - <?xml version="1.0" encoding="utf-16"?> -<GeneralSettings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> - <Language Code="en-US" /> - <CanShowSplash>true</CanShowSplash> - <CanCheckVersion>true</CanCheckVersion> - <CompileBeforeParse>true</CompileBeforeParse> - <IsSmartIndenterPrompted>false</IsSmartIndenterPrompted> - <IsAutoSaveEnabled>false</IsAutoSaveEnabled> - <AutoSavePeriod>10</AutoSavePeriod> - <UserEditedLogLevel>false</UserEditedLogLevel> - <MinimumLogLevel>0</MinimumLogLevel> - <EnableExperimentalFeatures /> -</GeneralSettings> + + <GeneralSettings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <Language Code="en-US" /> + <CanShowSplash>true</CanShowSplash> + <CanCheckVersion>true</CanCheckVersion> + <CompileBeforeParse>true</CompileBeforeParse> + <IsSmartIndenterPrompted>false</IsSmartIndenterPrompted> + <IsAutoSaveEnabled>false</IsAutoSaveEnabled> + <AutoSavePeriod>10</AutoSavePeriod> + <UserEditedLogLevel>false</UserEditedLogLevel> + <MinimumLogLevel>0</MinimumLogLevel> + <EnableExperimentalFeatures /> + </GeneralSettings> + - <?xml version="1.0" encoding="utf-16"?> -<CodeInspectionSettings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> - <CodeInspections> - <CodeInspection Name="BooleanAssignedInIfElseInspection" Severity="Warning" InspectionType="MaintainabilityAndReadabilityIssues" /> - <CodeInspection Name="ObsoleteErrorSyntaxInspection" Severity="Suggestion" InspectionType="LanguageOpportunities" /> - <CodeInspection Name="StopKeywordInspection" Severity="Suggestion" InspectionType="CodeQualityIssues" /> - <CodeInspection Name="UnhandledOnErrorResumeNextInspection" Severity="Warning" InspectionType="CodeQualityIssues" /> - <CodeInspection Name="EmptyStringLiteralInspection" Severity="Warning" InspectionType="LanguageOpportunities" /> - <CodeInspection Name="ImplicitByRefModifierInspection" Severity="Hint" InspectionType="CodeQualityIssues" /> - <CodeInspection Name="MissingAttributeInspection" Severity="Warning" InspectionType="RubberduckOpportunities" /> - <CodeInspection Name="FunctionReturnValueNotUsedInspection" Severity="Warning" InspectionType="CodeQualityIssues" /> - <CodeInspection Name="IllegalAnnotationInspection" Severity="Error" InspectionType="RubberduckOpportunities" /> - <CodeInspection Name="RedundantByRefModifierInspection" Severity="DoNotShow" InspectionType="CodeQualityIssues" /> - <CodeInspection Name="MissingAnnotationArgumentInspection" Severity="Error" InspectionType="CodeQualityIssues" /> - <CodeInspection Name="ModuleScopeDimKeywordInspection" Severity="Suggestion" InspectionType="LanguageOpportunities" /> - <CodeInspection Name="MultilineParameterInspection" Severity="Suggestion" InspectionType="MaintainabilityAndReadabilityIssues" /> - <CodeInspection Name="MultipleDeclarationsInspection" Severity="Warning" InspectionType="MaintainabilityAndReadabilityIssues" /> - <CodeInspection Name="ObsoleteCallStatementInspection" Severity="Suggestion" InspectionType="LanguageOpportunities" /> - <CodeInspection Name="ObsoleteCommentSyntaxInspection" Severity="Suggestion" InspectionType="LanguageOpportunities" /> - <CodeInspection Name="ObsoleteLetStatementInspection" Severity="Suggestion" InspectionType="LanguageOpportunities" /> - <CodeInspection Name="OptionBaseInspection" Severity="Hint" InspectionType="MaintainabilityAndReadabilityIssues" /> - <CodeInspection Name="RedundantOptionInspection" Severity="Hint" InspectionType="LanguageOpportunities" /> - <CodeInspection Name="OptionExplicitInspection" Severity="Error" InspectionType="CodeQualityIssues" /> - <CodeInspection Name="ProcedureCanBeWrittenAsFunctionInspection" Severity="Suggestion" InspectionType="LanguageOpportunities" /> - <CodeInspection Name="ApplicationWorksheetFunctionInspection" Severity="Suggestion" InspectionType="CodeQualityIssues" /> - <CodeInspection Name="AssignedByValParameterInspection" Severity="Warning" InspectionType="CodeQualityIssues" /> - <CodeInspection Name="EmptyModuleInspection" Severity="Hint" InspectionType="MaintainabilityAndReadabilityIssues" /> - <CodeInspection Name="LineLabelNotUsedInspection" Severity="Warning" InspectionType="CodeQualityIssues" /> - <CodeInspection Name="IntegerDataTypeInspection" Severity="Hint" InspectionType="CodeQualityIssues" /> - <CodeInspection Name="ShadowedDeclarationInspection" Severity="DoNotShow" InspectionType="CodeQualityIssues" /> - <CodeInspection Name="ConstantNotUsedInspection" Severity="Warning" InspectionType="CodeQualityIssues" /> - <CodeInspection Name="DefaultProjectNameInspection" Severity="Suggestion" InspectionType="MaintainabilityAndReadabilityIssues" /> - <CodeInspection Name="EmptyCaseBlockInspection" Severity="Warning" InspectionType="MaintainabilityAndReadabilityIssues" /> - <CodeInspection Name="EmptyDoWhileBlockInspection" Severity="Suggestion" InspectionType="MaintainabilityAndReadabilityIssues" /> - <CodeInspection Name="EmptyElseBlockInspection" Severity="Warning" InspectionType="MaintainabilityAndReadabilityIssues" /> - <CodeInspection Name="EmptyForEachBlockInspection" Severity="Warning" InspectionType="MaintainabilityAndReadabilityIssues" /> - <CodeInspection Name="EmptyForLoopBlockInspection" Severity="Warning" InspectionType="MaintainabilityAndReadabilityIssues" /> - <CodeInspection Name="EmptyIfBlockInspection" Severity="Warning" InspectionType="MaintainabilityAndReadabilityIssues" /> - <CodeInspection Name="EmptyWhileWendBlockInspection" Severity="Warning" InspectionType="MaintainabilityAndReadabilityIssues" /> - <CodeInspection Name="EncapsulatePublicFieldInspection" Severity="Suggestion" InspectionType="MaintainabilityAndReadabilityIssues" /> - <CodeInspection Name="HostSpecificExpressionInspection" Severity="Warning" InspectionType="LanguageOpportunities" /> - <CodeInspection Name="HungarianNotationInspection" Severity="Suggestion" InspectionType="MaintainabilityAndReadabilityIssues" /> - <CodeInspection Name="ImplicitActiveSheetReferenceInspection" Severity="Warning" InspectionType="LanguageOpportunities" /> - <CodeInspection Name="ImplicitActiveWorkbookReferenceInspection" Severity="Warning" InspectionType="LanguageOpportunities" /> - <CodeInspection Name="ImplicitDefaultMemberAssignmentInspection" Severity="Suggestion" InspectionType="LanguageOpportunities" /> - <CodeInspection Name="ImplicitPublicMemberInspection" Severity="Hint" InspectionType="LanguageOpportunities" /> - <CodeInspection Name="ImplicitVariantReturnTypeInspection" Severity="Hint" InspectionType="LanguageOpportunities" /> - <CodeInspection Name="MemberNotOnInterfaceInspection" Severity="Warning" InspectionType="CodeQualityIssues" /> - <CodeInspection Name="MoveFieldCloserToUsageInspection" Severity="Hint" InspectionType="MaintainabilityAndReadabilityIssues" /> - <CodeInspection Name="NonReturningFunctionInspection" Severity="Error" InspectionType="CodeQualityIssues" /> - <CodeInspection Name="ObjectVariableNotSetInspection" Severity="Error" InspectionType="CodeQualityIssues" /> - <CodeInspection Name="ObsoleteGlobalInspection" Severity="Suggestion" InspectionType="LanguageOpportunities" /> - <CodeInspection Name="ObsoleteTypeHintInspection" Severity="Suggestion" InspectionType="LanguageOpportunities" /> - <CodeInspection Name="ParameterCanBeByValInspection" Severity="Suggestion" InspectionType="MaintainabilityAndReadabilityIssues" /> - <CodeInspection Name="ParameterNotUsedInspection" Severity="Warning" InspectionType="CodeQualityIssues" /> - <CodeInspection Name="ProcedureNotUsedInspection" Severity="Warning" InspectionType="CodeQualityIssues" /> - <CodeInspection Name="SelfAssignedDeclarationInspection" Severity="Suggestion" InspectionType="CodeQualityIssues" /> - <CodeInspection Name="UnassignedVariableUsageInspection" Severity="Error" InspectionType="CodeQualityIssues" /> - <CodeInspection Name="UndeclaredVariableInspection" Severity="Error" InspectionType="CodeQualityIssues" /> - <CodeInspection Name="UntypedFunctionUsageInspection" Severity="Hint" InspectionType="LanguageOpportunities" /> - <CodeInspection Name="UseMeaningfulNameInspection" Severity="Suggestion" InspectionType="MaintainabilityAndReadabilityIssues" /> - <CodeInspection Name="VariableNotAssignedInspection" Severity="Warning" InspectionType="CodeQualityIssues" /> - <CodeInspection Name="VariableNotUsedInspection" Severity="Warning" InspectionType="CodeQualityIssues" /> - <CodeInspection Name="VariableTypeNotDeclaredInspection" Severity="Warning" InspectionType="LanguageOpportunities" /> - <CodeInspection Name="WriteOnlyPropertyInspection" Severity="Suggestion" InspectionType="CodeQualityIssues" /> - <CodeInspection Name="DefTypeStatementInspection" Severity="Suggestion" InspectionType="LanguageOpportunities" /> - <CodeInspection Name="StepIsNotSpecifiedInspection" Severity="DoNotShow" InspectionType="LanguageOpportunities" /> - <CodeInspection Name="StepOneIsRedundantInspection" Severity="Hint" InspectionType="LanguageOpportunities" /> - <CodeInspection Name="SheetAccessedUsingStringInspection" Severity="Suggestion" InspectionType="LanguageOpportunities" /> - <CodeInspection Name="ObsoleteMemberUsageInspection" Severity="Warning" InspectionType="MaintainabilityAndReadabilityIssues" /> - <CodeInspection Name="ObsoleteCallingConventionInspection" Severity="Warning" InspectionType="CodeQualityIssues" /> - <CodeInspection Name="DuplicatedAnnotationInspection" Severity="Error" InspectionType="RubberduckOpportunities" /> - <CodeInspection Name="ModuleWithoutFolderInspection" Severity="Suggestion" InspectionType="RubberduckOpportunities" /> - <CodeInspection Name="OnLocalErrorInspection" Severity="Suggestion" InspectionType="LanguageOpportunities" /> - <CodeInspection Name="IsMissingOnInappropriateArgumentInspection" Severity="Warning" InspectionType="CodeQualityIssues" /> - <CodeInspection Name="IsMissingWithNonArgumentParameterInspection" Severity="Warning" InspectionType="CodeQualityIssues" /> - <CodeInspection Name="AssignmentNotUsedInspection" Severity="Suggestion" InspectionType="CodeQualityIssues" /> - <CodeInspection Name="UnderscoreInPublicClassModuleMemberInspection" Severity="Warning" InspectionType="CodeQualityIssues" /> - </CodeInspections> - <WhitelistedIdentifiers /> - <RunInspectionsOnSuccessfulParse>true</RunInspectionsOnSuccessfulParse> -</CodeInspectionSettings> + + <CodeInspectionSettings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> + <CodeInspections> + <CodeInspection Name="BooleanAssignedInIfElseInspection" Severity="Warning" InspectionType="MaintainabilityAndReadabilityIssues" /> + <CodeInspection Name="ObsoleteErrorSyntaxInspection" Severity="Suggestion" InspectionType="LanguageOpportunities" /> + <CodeInspection Name="StopKeywordInspection" Severity="Suggestion" InspectionType="CodeQualityIssues" /> + <CodeInspection Name="UnhandledOnErrorResumeNextInspection" Severity="Warning" InspectionType="CodeQualityIssues" /> + <CodeInspection Name="EmptyStringLiteralInspection" Severity="Warning" InspectionType="LanguageOpportunities" /> + <CodeInspection Name="ImplicitByRefModifierInspection" Severity="Hint" InspectionType="CodeQualityIssues" /> + <CodeInspection Name="MissingAttributeInspection" Severity="Warning" InspectionType="RubberduckOpportunities" /> + <CodeInspection Name="FunctionReturnValueNotUsedInspection" Severity="Warning" InspectionType="CodeQualityIssues" /> + <CodeInspection Name="IllegalAnnotationInspection" Severity="Error" InspectionType="RubberduckOpportunities" /> + <CodeInspection Name="RedundantByRefModifierInspection" Severity="DoNotShow" InspectionType="CodeQualityIssues" /> + <CodeInspection Name="MissingAnnotationArgumentInspection" Severity="Error" InspectionType="CodeQualityIssues" /> + <CodeInspection Name="ModuleScopeDimKeywordInspection" Severity="Suggestion" InspectionType="LanguageOpportunities" /> + <CodeInspection Name="MultilineParameterInspection" Severity="Suggestion" InspectionType="MaintainabilityAndReadabilityIssues" /> + <CodeInspection Name="MultipleDeclarationsInspection" Severity="Warning" InspectionType="MaintainabilityAndReadabilityIssues" /> + <CodeInspection Name="ObsoleteCallStatementInspection" Severity="Suggestion" InspectionType="LanguageOpportunities" /> + <CodeInspection Name="ObsoleteCommentSyntaxInspection" Severity="Suggestion" InspectionType="LanguageOpportunities" /> + <CodeInspection Name="ObsoleteLetStatementInspection" Severity="Suggestion" InspectionType="LanguageOpportunities" /> + <CodeInspection Name="OptionBaseInspection" Severity="Hint" InspectionType="MaintainabilityAndReadabilityIssues" /> + <CodeInspection Name="RedundantOptionInspection" Severity="Hint" InspectionType="LanguageOpportunities" /> + <CodeInspection Name="OptionExplicitInspection" Severity="Error" InspectionType="CodeQualityIssues" /> + <CodeInspection Name="ProcedureCanBeWrittenAsFunctionInspection" Severity="Suggestion" InspectionType="LanguageOpportunities" /> + <CodeInspection Name="ApplicationWorksheetFunctionInspection" Severity="Suggestion" InspectionType="CodeQualityIssues" /> + <CodeInspection Name="AssignedByValParameterInspection" Severity="Warning" InspectionType="CodeQualityIssues" /> + <CodeInspection Name="EmptyModuleInspection" Severity="Hint" InspectionType="MaintainabilityAndReadabilityIssues" /> + <CodeInspection Name="LineLabelNotUsedInspection" Severity="Warning" InspectionType="CodeQualityIssues" /> + <CodeInspection Name="IntegerDataTypeInspection" Severity="Hint" InspectionType="CodeQualityIssues" /> + <CodeInspection Name="ShadowedDeclarationInspection" Severity="DoNotShow" InspectionType="CodeQualityIssues" /> + <CodeInspection Name="ConstantNotUsedInspection" Severity="Warning" InspectionType="CodeQualityIssues" /> + <CodeInspection Name="DefaultProjectNameInspection" Severity="Suggestion" InspectionType="MaintainabilityAndReadabilityIssues" /> + <CodeInspection Name="EmptyCaseBlockInspection" Severity="Warning" InspectionType="MaintainabilityAndReadabilityIssues" /> + <CodeInspection Name="EmptyDoWhileBlockInspection" Severity="Suggestion" InspectionType="MaintainabilityAndReadabilityIssues" /> + <CodeInspection Name="EmptyElseBlockInspection" Severity="Warning" InspectionType="MaintainabilityAndReadabilityIssues" /> + <CodeInspection Name="EmptyForEachBlockInspection" Severity="Warning" InspectionType="MaintainabilityAndReadabilityIssues" /> + <CodeInspection Name="EmptyForLoopBlockInspection" Severity="Warning" InspectionType="MaintainabilityAndReadabilityIssues" /> + <CodeInspection Name="EmptyIfBlockInspection" Severity="Warning" InspectionType="MaintainabilityAndReadabilityIssues" /> + <CodeInspection Name="EmptyWhileWendBlockInspection" Severity="Warning" InspectionType="MaintainabilityAndReadabilityIssues" /> + <CodeInspection Name="EncapsulatePublicFieldInspection" Severity="Suggestion" InspectionType="MaintainabilityAndReadabilityIssues" /> + <CodeInspection Name="HostSpecificExpressionInspection" Severity="Warning" InspectionType="LanguageOpportunities" /> + <CodeInspection Name="HungarianNotationInspection" Severity="Suggestion" InspectionType="MaintainabilityAndReadabilityIssues" /> + <CodeInspection Name="ImplicitActiveSheetReferenceInspection" Severity="Warning" InspectionType="LanguageOpportunities" /> + <CodeInspection Name="ImplicitActiveWorkbookReferenceInspection" Severity="Warning" InspectionType="LanguageOpportunities" /> + <CodeInspection Name="ImplicitDefaultMemberAssignmentInspection" Severity="Suggestion" InspectionType="LanguageOpportunities" /> + <CodeInspection Name="ImplicitPublicMemberInspection" Severity="Hint" InspectionType="LanguageOpportunities" /> + <CodeInspection Name="ImplicitVariantReturnTypeInspection" Severity="Hint" InspectionType="LanguageOpportunities" /> + <CodeInspection Name="MemberNotOnInterfaceInspection" Severity="Warning" InspectionType="CodeQualityIssues" /> + <CodeInspection Name="MoveFieldCloserToUsageInspection" Severity="Hint" InspectionType="MaintainabilityAndReadabilityIssues" /> + <CodeInspection Name="NonReturningFunctionInspection" Severity="Error" InspectionType="CodeQualityIssues" /> + <CodeInspection Name="ObjectVariableNotSetInspection" Severity="Error" InspectionType="CodeQualityIssues" /> + <CodeInspection Name="ObsoleteGlobalInspection" Severity="Suggestion" InspectionType="LanguageOpportunities" /> + <CodeInspection Name="ObsoleteTypeHintInspection" Severity="Suggestion" InspectionType="LanguageOpportunities" /> + <CodeInspection Name="ParameterCanBeByValInspection" Severity="Suggestion" InspectionType="MaintainabilityAndReadabilityIssues" /> + <CodeInspection Name="ParameterNotUsedInspection" Severity="Warning" InspectionType="CodeQualityIssues" /> + <CodeInspection Name="ProcedureNotUsedInspection" Severity="Warning" InspectionType="CodeQualityIssues" /> + <CodeInspection Name="SelfAssignedDeclarationInspection" Severity="Suggestion" InspectionType="CodeQualityIssues" /> + <CodeInspection Name="UnassignedVariableUsageInspection" Severity="Error" InspectionType="CodeQualityIssues" /> + <CodeInspection Name="UndeclaredVariableInspection" Severity="Error" InspectionType="CodeQualityIssues" /> + <CodeInspection Name="UntypedFunctionUsageInspection" Severity="Hint" InspectionType="LanguageOpportunities" /> + <CodeInspection Name="UseMeaningfulNameInspection" Severity="Suggestion" InspectionType="MaintainabilityAndReadabilityIssues" /> + <CodeInspection Name="VariableNotAssignedInspection" Severity="Warning" InspectionType="CodeQualityIssues" /> + <CodeInspection Name="VariableNotUsedInspection" Severity="Warning" InspectionType="CodeQualityIssues" /> + <CodeInspection Name="VariableTypeNotDeclaredInspection" Severity="Warning" InspectionType="LanguageOpportunities" /> + <CodeInspection Name="WriteOnlyPropertyInspection" Severity="Suggestion" InspectionType="CodeQualityIssues" /> + <CodeInspection Name="DefTypeStatementInspection" Severity="Suggestion" InspectionType="LanguageOpportunities" /> + <CodeInspection Name="StepIsNotSpecifiedInspection" Severity="DoNotShow" InspectionType="LanguageOpportunities" /> + <CodeInspection Name="StepOneIsRedundantInspection" Severity="Hint" InspectionType="LanguageOpportunities" /> + <CodeInspection Name="SheetAccessedUsingStringInspection" Severity="Suggestion" InspectionType="LanguageOpportunities" /> + <CodeInspection Name="ObsoleteMemberUsageInspection" Severity="Warning" InspectionType="MaintainabilityAndReadabilityIssues" /> + <CodeInspection Name="ObsoleteCallingConventionInspection" Severity="Warning" InspectionType="CodeQualityIssues" /> + <CodeInspection Name="DuplicatedAnnotationInspection" Severity="Error" InspectionType="RubberduckOpportunities" /> + <CodeInspection Name="ModuleWithoutFolderInspection" Severity="Suggestion" InspectionType="RubberduckOpportunities" /> + <CodeInspection Name="OnLocalErrorInspection" Severity="Suggestion" InspectionType="LanguageOpportunities" /> + <CodeInspection Name="IsMissingOnInappropriateArgumentInspection" Severity="Warning" InspectionType="CodeQualityIssues" /> + <CodeInspection Name="IsMissingWithNonArgumentParameterInspection" Severity="Warning" InspectionType="CodeQualityIssues" /> + <CodeInspection Name="AssignmentNotUsedInspection" Severity="Suggestion" InspectionType="CodeQualityIssues" /> + <CodeInspection Name="UnderscoreInPublicClassModuleMemberInspection" Severity="Warning" InspectionType="CodeQualityIssues" /> + <CodeInspection Name="ExcelUdfNameIsValidCellReferenceInspection" Severity="Warning" InspectionType="CodeQualityIssues" /> + </CodeInspections> + <WhitelistedIdentifiers /> + <RunInspectionsOnSuccessfulParse>true</RunInspectionsOnSuccessfulParse> + </CodeInspectionSettings> + - <?xml version="1.0" encoding="utf-16"?> -<AutoCompleteSettings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" IsEnabled="false"> - <SmartConcat> - <IsEnabled>false</IsEnabled> - <ConcatVbNewLineModifier>None</ConcatVbNewLineModifier> - </SmartConcat> - <SelfClosingPairs IsEnabled="false" /> - <BlockCompletion IsEnabled="false" CompleteOnEnter="false" CompleteOnTab="false" /> -</AutoCompleteSettings> + + <AutoCompleteSettings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" IsEnabled="false"> + <SmartConcat IsEnabled="false"> + <ConcatVbNewLineModifier>None</ConcatVbNewLineModifier> + <ConcatMaxLines>25</ConcatMaxLines> + </SmartConcat> + <SelfClosingPairs IsEnabled="false" /> + <BlockCompletion IsEnabled="false" CompleteOnEnter="false" CompleteOnTab="false" /> + </AutoCompleteSettings> + \ No newline at end of file diff --git a/Rubberduck.Core/Rubberduck.Core.csproj b/Rubberduck.Core/Rubberduck.Core.csproj index 46ea79c2e7..97cb371f49 100644 --- a/Rubberduck.Core/Rubberduck.Core.csproj +++ b/Rubberduck.Core/Rubberduck.Core.csproj @@ -81,4 +81,17 @@ 2.0.20525 + + + True + True + Settings.settings + + + + + SettingsSingleFileGenerator + Settings.Designer.cs + + \ No newline at end of file diff --git a/Rubberduck.Core/app.config b/Rubberduck.Core/app.config index 131b118527..f0be996d6a 100644 --- a/Rubberduck.Core/app.config +++ b/Rubberduck.Core/app.config @@ -1,9 +1,6 @@ - -
- @@ -13,401 +10,5 @@ - - - - - - R - true - true - false - true - CodePaneRefactorRenameCommand - - - - - - - F - true - true - false - true - RefactorEncapsulateFieldCommand - - - - - - - M - true - true - false - true - RefactorExtractMethodCommand - - - - - - - C - true - true - false - true - RefactorMoveCloserToUsageCommand - - - - - - - R - true - false - false - true - CodeExplorerCommand - - - - - - - E - true - true - false - true - ExportAllCommand - - - - - - - T - true - false - false - true - FindSymbolCommand - - - - - - - M - true - false - false - true - IndentCurrentModuleCommand - - - - - - - P - true - false - false - true - IndentCurrentProcedureCommand - - - - - - - I - true - true - false - true - InspectionResultsCommand - - - - - - - ` - true - false - false - true - ReparseCommand - - - - - - - T - true - true - false - true - TestExplorerCommand - - - - - - - - - - - - - - - - - - - - - - false - false - false - false - true - false - false - - - - - - - LateBinding - StrictAssert - true - true - false - - - - - - - - true - true - true - false - false - 10 - false - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - true - - - - - - - - None - 25 - - - - - - - - diff --git a/Rubberduck.Resources/Inspections/InspectionInfo.Designer.cs b/Rubberduck.Resources/Inspections/InspectionInfo.Designer.cs index 37092bf41d..b00e372b6e 100644 --- a/Rubberduck.Resources/Inspections/InspectionInfo.Designer.cs +++ b/Rubberduck.Resources/Inspections/InspectionInfo.Designer.cs @@ -231,6 +231,15 @@ public static string ExcelMemberMayReturnNothingInspection { } } + /// + /// Looks up a localized string similar to Functions that are visible to Excel as User-Defined Functions will return a '#REF' error when used on a Worksheet if they match the name of a valid cell reference. If the function is intended to be used as a UDF, it must be renamed. If the function is not intended to be used as a UDF, it should be scoped as 'Private' or moved out of a standard Module.. + /// + public static string ExcelUdfNameIsValidCellReferenceInspection { + get { + return ResourceManager.GetString("ExcelUdfNameIsValidCellReferenceInspection", resourceCulture); + } + } + /// /// Looks up a localized string similar to A member is written as a function, but used as a procedure. Unless the function is recursive, consider converting the 'Function' into a 'Sub'. If the function is recursive, none of its external callers are using the returned value.. /// diff --git a/Rubberduck.Resources/Inspections/InspectionInfo.resx b/Rubberduck.Resources/Inspections/InspectionInfo.resx index 5b3b30bc0d..c154e7d580 100644 --- a/Rubberduck.Resources/Inspections/InspectionInfo.resx +++ b/Rubberduck.Resources/Inspections/InspectionInfo.resx @@ -355,4 +355,7 @@ If the parameter can be null, ignore this inspection result; passing a null valu A procedure that returns an object may return 'Nothing'. That will cause a runtime error 91 - "Object variable or With block variable not set" on subsequent member access. Perform an 'Is Nothing' check after the 'Set' assignment to guard against runtime errors. + + Functions that are visible to Excel as User-Defined Functions will return a '#REF' error when used on a Worksheet if they match the name of a valid cell reference. If the function is intended to be used as a UDF, it must be renamed. If the function is not intended to be used as a UDF, it should be scoped as 'Private' or moved out of a standard Module. + \ No newline at end of file diff --git a/Rubberduck.Resources/Inspections/InspectionNames.Designer.cs b/Rubberduck.Resources/Inspections/InspectionNames.Designer.cs index c0e9019906..2d213416c7 100644 --- a/Rubberduck.Resources/Inspections/InspectionNames.Designer.cs +++ b/Rubberduck.Resources/Inspections/InspectionNames.Designer.cs @@ -231,6 +231,15 @@ public static string ExcelMemberMayReturnNothingInspection { } } + /// + /// Looks up a localized string similar to Function is hidden by Excel cell reference. + /// + public static string ExcelUdfNameIsValidCellReferenceInspection { + get { + return ResourceManager.GetString("ExcelUdfNameIsValidCellReferenceInspection", resourceCulture); + } + } + /// /// Looks up a localized string similar to Function return value is never used. /// diff --git a/Rubberduck.Resources/Inspections/InspectionNames.resx b/Rubberduck.Resources/Inspections/InspectionNames.resx index adceef18a0..d81c047341 100644 --- a/Rubberduck.Resources/Inspections/InspectionNames.resx +++ b/Rubberduck.Resources/Inspections/InspectionNames.resx @@ -354,4 +354,7 @@ Member access may return 'Nothing' + + Function is hidden by Excel cell reference + \ No newline at end of file diff --git a/Rubberduck.Resources/Inspections/InspectionResults.Designer.cs b/Rubberduck.Resources/Inspections/InspectionResults.Designer.cs index 48eb38ad84..2fdbade3b5 100644 --- a/Rubberduck.Resources/Inspections/InspectionResults.Designer.cs +++ b/Rubberduck.Resources/Inspections/InspectionResults.Designer.cs @@ -231,6 +231,15 @@ public static string ExcelMemberMayReturnNothingInspection { } } + /// + /// Looks up a localized string similar to '{0}' is hidden by a valid Excel cell reference.. + /// + public static string ExcelUdfNameIsValidCellReferenceInspection { + get { + return ResourceManager.GetString("ExcelUdfNameIsValidCellReferenceInspection", resourceCulture); + } + } + /// /// Looks up a localized string similar to Return value of function '{0}' is never used.. /// diff --git a/Rubberduck.Resources/Inspections/InspectionResults.resx b/Rubberduck.Resources/Inspections/InspectionResults.resx index fc4312001e..a28d86069e 100644 --- a/Rubberduck.Resources/Inspections/InspectionResults.resx +++ b/Rubberduck.Resources/Inspections/InspectionResults.resx @@ -385,4 +385,8 @@ Result of '{0}' call is not tested for 'Nothing'. {0} Member identifier + + '{0}' is hidden by a valid Excel cell reference. + {0} Function name + \ No newline at end of file diff --git a/Rubberduck.Resources/Settings/AutoCompletesPage.Designer.cs b/Rubberduck.Resources/Settings/AutoCompletesPage.Designer.cs index 18a7c254a2..a8f65bafa8 100644 --- a/Rubberduck.Resources/Settings/AutoCompletesPage.Designer.cs +++ b/Rubberduck.Resources/Settings/AutoCompletesPage.Designer.cs @@ -132,6 +132,15 @@ public static string EnableSmartConcat { } } + /// + /// Looks up a localized string similar to Maximum Lines. + /// + public static string MaxConcatLines { + get { + return ResourceManager.GetString("MaxConcatLines", resourceCulture); + } + } + /// /// Looks up a localized string similar to Autocompletion Settings. /// diff --git a/RubberduckTests/Inspections/ExcelUdfNameIsValidCellReferenceInspectionTests.cs b/RubberduckTests/Inspections/ExcelUdfNameIsValidCellReferenceInspectionTests.cs new file mode 100644 index 0000000000..334b4e4c64 --- /dev/null +++ b/RubberduckTests/Inspections/ExcelUdfNameIsValidCellReferenceInspectionTests.cs @@ -0,0 +1,128 @@ +using System.Linq; +using System.Threading; +using NUnit.Framework; +using Rubberduck.Inspections.Inspections.Concrete; +using Rubberduck.VBEditor.SafeComWrappers; +using RubberduckTests.Mocks; + +namespace RubberduckTests.Inspections +{ + [TestFixture] + public class ExcelUdfNameIsValidCellReferenceInspectionTests + { + [TestCase("a1")] + [TestCase("A1")] + [TestCase("AA1")] + [TestCase("ZZ1")] + [TestCase("XFD1")] + [TestCase("XEZ1")] + [TestCase("WZZ1")] + [TestCase("Foo42")] + [TestCase("XFD1048576")] + [Category("Inspections")] + public void ExcelUdfNameIsValidCellReferenceInspection_ReturnsResult_ValidCells(string identifier) + { + const string codeTemplate = +@"Public Function {0}() As Long + {0} = 42 +End Function +"; + + Assert.AreEqual(1, InspectionResultCount(string.Format(codeTemplate, identifier), ComponentType.StandardModule)); + } + + [TestCase("Foo")] + [TestCase("XXX69")] + [TestCase("XKCD42")] + [TestCase("AAA1234567")] + [Category("Inspections")] + public void ExcelUdfNameIsValidCellReferenceInspection_ReturnsNoResult_InvalidAsCell(string identifier) + { + const string codeTemplate = +@"Public Function {0}() As Long + {0} = 42 +End Function +"; + + Assert.AreEqual(0, InspectionResultCount(string.Format(codeTemplate, identifier), ComponentType.StandardModule)); + } + + [TestCase(ComponentType.ClassModule)] + [TestCase(ComponentType.UserForm)] + [TestCase(ComponentType.DocObject)] + [Category("Inspections")] + public void ExcelUdfNameIsValidCellReferenceInspection_ReturnsNoResult_NonStandardModule(ComponentType moduleType) + { + const string code = +@"Public Function A1() As Long + A1 = 42 +End Function +"; + + Assert.AreEqual(0, InspectionResultCount(code, moduleType)); + } + + [Test] + [Category("Inspections")] + public void ExcelUdfNameIsValidCellReferenceInspection_ReturnsNoResult_Ignored() + { + const string code = +@"'@Ignore ExcelUdfNameIsValidCellReference +Public Function A1() As Long + A1 = 42 +End Function +"; + + Assert.AreEqual(0, InspectionResultCount(code, ComponentType.StandardModule)); + } + + [Test] + [Category("Inspections")] + public void ExcelUdfNameIsValidCellReferenceInspection_ReturnsNoResult_PrivateFunction() + { + const string code = +@"Private Function A1() As Long + A1 = 42 +End Function +"; + + Assert.AreEqual(0, InspectionResultCount(code, ComponentType.StandardModule)); + } + + [TestCase("Sub A1()", "Sub")] + [TestCase("Property Get A1() As Long", "Property")] + [TestCase("Property Let A1(foo As Long)", "Property")] + [TestCase("Property Set A1(foo As Variant)", "Property")] + [Category("Inspections")] + public void ExcelUdfNameIsValidCellReferenceInspection_ReturnsNoResult_NonFunction(string signature, string ending) + { + const string codeTemplate = +@"{0} + A1 = 42 +End {1} +"; + + Assert.AreEqual(0, InspectionResultCount(string.Format(codeTemplate, signature, ending), ComponentType.StandardModule)); + } + + private static int InspectionResultCount(string inputCode, ComponentType moduleType) + { + var builder = new MockVbeBuilder(); + var project = builder.ProjectBuilder("VBAProject", ProjectProtection.Unprotected) + .AddComponent("UnderTest", moduleType, inputCode) + .AddReference("Excel", MockVbeBuilder.LibraryPathMsExcel, 1, 8, true) + .Build(); + + var vbe = builder.AddProject(project).Build(); + + using (var state = MockParser.CreateAndParse(vbe.Object)) + { + + var inspection = new ExcelUdfNameIsValidCellReferenceInspection(state); + var inspectionResults = inspection.GetInspectionResults(CancellationToken.None); + + return inspectionResults.Count(); + } + } + } +}