From d51c2a595022ff9a043fb663de80208155f8aefa Mon Sep 17 00:00:00 2001 From: Mathieu Guindon Date: Sun, 6 Jan 2019 21:07:18 -0500 Subject: [PATCH 01/26] refactored AC namespaces --- .../AutoComplete/{Service => }/AutoCompleteService.cs | 2 +- .../{Service => SelfClosingPairs}/SelfClosingPair.cs | 6 +++--- .../SelfClosingPairCompletionService.cs | 2 +- .../{Service => SelfClosingPairs}/SelfClosingPairHandler.cs | 3 +-- .../AutoComplete/{Service => }/ShowIntelliSenseCommand.cs | 2 +- .../{Service => SmartConcat}/SmartConcatenationHandler.cs | 2 +- Rubberduck.Core/Common/RubberduckHooks.cs | 1 - Rubberduck.Main/Root/RubberduckIoCInstaller.cs | 1 - .../AutoComplete/SelfClosingPairCompletionServiceTests.cs | 2 +- RubberduckTests/AutoComplete/SelfClosingPairHandlerTests.cs | 2 +- RubberduckTests/AutoComplete/SelfClosingPairTestInfo.cs | 2 +- RubberduckTests/AutoComplete/SmartConcatCompletionTests.cs | 2 +- 12 files changed, 12 insertions(+), 15 deletions(-) rename Rubberduck.Core/AutoComplete/{Service => }/AutoCompleteService.cs (99%) rename Rubberduck.Core/AutoComplete/{Service => SelfClosingPairs}/SelfClosingPair.cs (90%) rename Rubberduck.Core/AutoComplete/{Service => SelfClosingPairs}/SelfClosingPairCompletionService.cs (99%) rename Rubberduck.Core/AutoComplete/{Service => SelfClosingPairs}/SelfClosingPairHandler.cs (98%) rename Rubberduck.Core/AutoComplete/{Service => }/ShowIntelliSenseCommand.cs (97%) rename Rubberduck.Core/AutoComplete/{Service => SmartConcat}/SmartConcatenationHandler.cs (98%) diff --git a/Rubberduck.Core/AutoComplete/Service/AutoCompleteService.cs b/Rubberduck.Core/AutoComplete/AutoCompleteService.cs similarity index 99% rename from Rubberduck.Core/AutoComplete/Service/AutoCompleteService.cs rename to Rubberduck.Core/AutoComplete/AutoCompleteService.cs index 2fa7c7cdd7..ecc25596ab 100644 --- a/Rubberduck.Core/AutoComplete/Service/AutoCompleteService.cs +++ b/Rubberduck.Core/AutoComplete/AutoCompleteService.cs @@ -5,7 +5,7 @@ using Rubberduck.Settings; using Rubberduck.VBEditor.Events; -namespace Rubberduck.AutoComplete.Service +namespace Rubberduck.AutoComplete { public class AutoCompleteService : IDisposable { diff --git a/Rubberduck.Core/AutoComplete/Service/SelfClosingPair.cs b/Rubberduck.Core/AutoComplete/SelfClosingPairs/SelfClosingPair.cs similarity index 90% rename from Rubberduck.Core/AutoComplete/Service/SelfClosingPair.cs rename to Rubberduck.Core/AutoComplete/SelfClosingPairs/SelfClosingPair.cs index 1266439f2b..6951a54a2f 100644 --- a/Rubberduck.Core/AutoComplete/Service/SelfClosingPair.cs +++ b/Rubberduck.Core/AutoComplete/SelfClosingPairs/SelfClosingPair.cs @@ -1,7 +1,7 @@ -using Rubberduck.VBEditor; -using System; +using System; +using Rubberduck.VBEditor; -namespace Rubberduck.AutoComplete.Service +namespace Rubberduck.AutoComplete.SelfClosingPairs { public class SelfClosingPair : IEquatable { diff --git a/Rubberduck.Core/AutoComplete/Service/SelfClosingPairCompletionService.cs b/Rubberduck.Core/AutoComplete/SelfClosingPairs/SelfClosingPairCompletionService.cs similarity index 99% rename from Rubberduck.Core/AutoComplete/Service/SelfClosingPairCompletionService.cs rename to Rubberduck.Core/AutoComplete/SelfClosingPairs/SelfClosingPairCompletionService.cs index fbe81b7f65..5860e61e30 100644 --- a/Rubberduck.Core/AutoComplete/Service/SelfClosingPairCompletionService.cs +++ b/Rubberduck.Core/AutoComplete/SelfClosingPairs/SelfClosingPairCompletionService.cs @@ -8,7 +8,7 @@ using Rubberduck.Parsing.VBA.Parsing; using Rubberduck.VBEditor; -namespace Rubberduck.AutoComplete.Service +namespace Rubberduck.AutoComplete.SelfClosingPairs { public class SelfClosingPairCompletionService { diff --git a/Rubberduck.Core/AutoComplete/Service/SelfClosingPairHandler.cs b/Rubberduck.Core/AutoComplete/SelfClosingPairs/SelfClosingPairHandler.cs similarity index 98% rename from Rubberduck.Core/AutoComplete/Service/SelfClosingPairHandler.cs rename to Rubberduck.Core/AutoComplete/SelfClosingPairs/SelfClosingPairHandler.cs index 7b8306087b..9737f0eea4 100644 --- a/Rubberduck.Core/AutoComplete/Service/SelfClosingPairHandler.cs +++ b/Rubberduck.Core/AutoComplete/SelfClosingPairs/SelfClosingPairHandler.cs @@ -1,12 +1,11 @@ using System.Collections.Generic; -using System.Diagnostics; using System.Linq; using Rubberduck.Settings; using Rubberduck.VBEditor; using Rubberduck.VBEditor.Events; using Rubberduck.VBEditor.SourceCodeHandling; -namespace Rubberduck.AutoComplete.Service +namespace Rubberduck.AutoComplete.SelfClosingPairs { public class SelfClosingPairHandler : AutoCompleteHandlerBase { diff --git a/Rubberduck.Core/AutoComplete/Service/ShowIntelliSenseCommand.cs b/Rubberduck.Core/AutoComplete/ShowIntelliSenseCommand.cs similarity index 97% rename from Rubberduck.Core/AutoComplete/Service/ShowIntelliSenseCommand.cs rename to Rubberduck.Core/AutoComplete/ShowIntelliSenseCommand.cs index 63b7d057ad..624cb9d096 100644 --- a/Rubberduck.Core/AutoComplete/Service/ShowIntelliSenseCommand.cs +++ b/Rubberduck.Core/AutoComplete/ShowIntelliSenseCommand.cs @@ -3,7 +3,7 @@ using Rubberduck.UI.Command; using Rubberduck.VBEditor.SafeComWrappers.Abstract; -namespace Rubberduck.AutoComplete.Service +namespace Rubberduck.AutoComplete { public interface IShowIntelliSenseCommand { diff --git a/Rubberduck.Core/AutoComplete/Service/SmartConcatenationHandler.cs b/Rubberduck.Core/AutoComplete/SmartConcat/SmartConcatenationHandler.cs similarity index 98% rename from Rubberduck.Core/AutoComplete/Service/SmartConcatenationHandler.cs rename to Rubberduck.Core/AutoComplete/SmartConcat/SmartConcatenationHandler.cs index 042438adaf..f2595ec350 100644 --- a/Rubberduck.Core/AutoComplete/Service/SmartConcatenationHandler.cs +++ b/Rubberduck.Core/AutoComplete/SmartConcat/SmartConcatenationHandler.cs @@ -4,7 +4,7 @@ using Rubberduck.VBEditor.Events; using Rubberduck.VBEditor.SourceCodeHandling; -namespace Rubberduck.AutoComplete.Service +namespace Rubberduck.AutoComplete.SmartConcat { /// /// Adds a line continuation when {ENTER} is pressed when inside a string literal. diff --git a/Rubberduck.Core/Common/RubberduckHooks.cs b/Rubberduck.Core/Common/RubberduckHooks.cs index 24b1a8105c..00337447c5 100644 --- a/Rubberduck.Core/Common/RubberduckHooks.cs +++ b/Rubberduck.Core/Common/RubberduckHooks.cs @@ -8,7 +8,6 @@ using Rubberduck.VBEditor.SafeComWrappers.Abstract; using Rubberduck.VBEditor.WindowsApi; using Rubberduck.AutoComplete; -using Rubberduck.AutoComplete.Service; namespace Rubberduck.Common { diff --git a/Rubberduck.Main/Root/RubberduckIoCInstaller.cs b/Rubberduck.Main/Root/RubberduckIoCInstaller.cs index 8a697a98c3..dd37e1d55f 100644 --- a/Rubberduck.Main/Root/RubberduckIoCInstaller.cs +++ b/Rubberduck.Main/Root/RubberduckIoCInstaller.cs @@ -41,7 +41,6 @@ using Rubberduck.VBEditor.Events; using Rubberduck.VBEditor.Utility; using Rubberduck.AutoComplete; -using Rubberduck.AutoComplete.Service; using Rubberduck.CodeAnalysis.CodeMetrics; using Rubberduck.Parsing.Rewriter; using Rubberduck.Parsing.VBA.ComReferenceLoading; diff --git a/RubberduckTests/AutoComplete/SelfClosingPairCompletionServiceTests.cs b/RubberduckTests/AutoComplete/SelfClosingPairCompletionServiceTests.cs index ecd27ae3a3..b7833dba2d 100644 --- a/RubberduckTests/AutoComplete/SelfClosingPairCompletionServiceTests.cs +++ b/RubberduckTests/AutoComplete/SelfClosingPairCompletionServiceTests.cs @@ -1,6 +1,6 @@ using NUnit.Framework; using System.Windows.Forms; -using Rubberduck.AutoComplete.Service; +using Rubberduck.AutoComplete.SelfClosingPairs; using Rubberduck.VBEditor; namespace RubberduckTests.AutoComplete diff --git a/RubberduckTests/AutoComplete/SelfClosingPairHandlerTests.cs b/RubberduckTests/AutoComplete/SelfClosingPairHandlerTests.cs index deab7071f6..bfeb4301b7 100644 --- a/RubberduckTests/AutoComplete/SelfClosingPairHandlerTests.cs +++ b/RubberduckTests/AutoComplete/SelfClosingPairHandlerTests.cs @@ -1,5 +1,5 @@ using NUnit.Framework; -using Rubberduck.AutoComplete.Service; +using Rubberduck.AutoComplete.SelfClosingPairs; using Rubberduck.VBEditor; namespace RubberduckTests.AutoComplete diff --git a/RubberduckTests/AutoComplete/SelfClosingPairTestInfo.cs b/RubberduckTests/AutoComplete/SelfClosingPairTestInfo.cs index a41f7b9c7d..b9144435a8 100644 --- a/RubberduckTests/AutoComplete/SelfClosingPairTestInfo.cs +++ b/RubberduckTests/AutoComplete/SelfClosingPairTestInfo.cs @@ -1,5 +1,5 @@ using Moq; -using Rubberduck.AutoComplete.Service; +using Rubberduck.AutoComplete.SelfClosingPairs; using Rubberduck.Settings; using Rubberduck.VBEditor; using Rubberduck.VBEditor.Events; diff --git a/RubberduckTests/AutoComplete/SmartConcatCompletionTests.cs b/RubberduckTests/AutoComplete/SmartConcatCompletionTests.cs index 330a8b4085..8dc992505f 100644 --- a/RubberduckTests/AutoComplete/SmartConcatCompletionTests.cs +++ b/RubberduckTests/AutoComplete/SmartConcatCompletionTests.cs @@ -1,7 +1,7 @@ using System.Linq; using Moq; using NUnit.Framework; -using Rubberduck.AutoComplete.Service; +using Rubberduck.AutoComplete.SmartConcat; using Rubberduck.Settings; using Rubberduck.VBEditor; using Rubberduck.VBEditor.ComManagement; From c9cd8a77e2e395a84a538e23862e74f33180bfd1 Mon Sep 17 00:00:00 2001 From: comintern Date: Tue, 15 Jan 2019 20:50:02 -0600 Subject: [PATCH 02/26] Stop churning results on filter and group, freshen up toolbar. --- .../InspectionFilterToBooleanConverter.cs | 35 +++ .../Inspections/InspectionResultsControl.xaml | 174 +++++------- .../Inspections/InspectionResultsViewModel.cs | 260 ++++++++++-------- ...onverter.cs => InspectionTypeConverter.cs} | 18 -- .../Icons/Custom/PNG/Severity.png | Bin 0 -> 892 bytes Rubberduck.Resources/Icons/Fugue/block.png | Bin 0 -> 630 bytes .../Inspections/InspectionsUI.Designer.cs | 55 +++- .../Inspections/InspectionsUI.resx | 15 + Rubberduck.Resources/Resources/light-bulb.png | Bin 0 -> 743 bytes .../Rubberduck.Resources.csproj | 3 + Rubberduck.Resources/RubberduckUI.Designer.cs | 33 ++- Rubberduck.Resources/RubberduckUI.resx | 9 + 12 files changed, 360 insertions(+), 242 deletions(-) create mode 100644 Rubberduck.Core/UI/Inspections/InspectionFilterToBooleanConverter.cs rename Rubberduck.Core/UI/Inspections/{InspectionDescriptionConverter.cs => InspectionTypeConverter.cs} (57%) create mode 100644 Rubberduck.Resources/Icons/Custom/PNG/Severity.png create mode 100644 Rubberduck.Resources/Icons/Fugue/block.png create mode 100644 Rubberduck.Resources/Resources/light-bulb.png diff --git a/Rubberduck.Core/UI/Inspections/InspectionFilterToBooleanConverter.cs b/Rubberduck.Core/UI/Inspections/InspectionFilterToBooleanConverter.cs new file mode 100644 index 0000000000..b4a127bda7 --- /dev/null +++ b/Rubberduck.Core/UI/Inspections/InspectionFilterToBooleanConverter.cs @@ -0,0 +1,35 @@ +using System; +using System.Globalization; +using System.Windows.Data; + +namespace Rubberduck.UI.Inspections +{ + internal class InspectionFilterToBooleanConverter : IValueConverter + { + private InspectionResultsFilter _state; + + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + if (!(parameter is InspectionResultsFilter flag) || + !(value is InspectionResultsFilter bound)) + { + return _state; + } + + _state = bound; + return _state.HasFlag(flag); + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + if (!(parameter is InspectionResultsFilter flag) || + !(value is bool isSet)) + { + return _state; + } + + _state ^= flag; + return _state; + } + } +} diff --git a/Rubberduck.Core/UI/Inspections/InspectionResultsControl.xaml b/Rubberduck.Core/UI/Inspections/InspectionResultsControl.xaml index d811263f99..960e431388 100644 --- a/Rubberduck.Core/UI/Inspections/InspectionResultsControl.xaml +++ b/Rubberduck.Core/UI/Inspections/InspectionResultsControl.xaml @@ -27,23 +27,16 @@ - - - - - - - - - - - - - + + + + + + @@ -54,7 +47,6 @@ - @@ -71,17 +63,28 @@ + + + + + + + + - + + ItemsSource="{Binding QuickFixes}" Background="Transparent"> @@ -90,81 +93,67 @@ + - - - - - - - - - - + + + + public static string ExportColumnHeader_Column { + get { + return ResourceManager.GetString("ExportColumnHeader_Column", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Component. + /// + public static string ExportColumnHeader_Component { + get { + return ResourceManager.GetString("ExportColumnHeader_Component", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Issue. + /// + public static string ExportColumnHeader_Issue { + get { + return ResourceManager.GetString("ExportColumnHeader_Issue", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Line. + /// + public static string ExportColumnHeader_Line { + get { + return ResourceManager.GetString("ExportColumnHeader_Line", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Project. + /// + public static string ExportColumnHeader_Project { + get { + return ResourceManager.GetString("ExportColumnHeader_Project", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Type. + /// + public static string ExportColumnHeader_Type { + get { + return ResourceManager.GetString("ExportColumnHeader_Type", resourceCulture); + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + public static System.Drawing.Bitmap ignore_once { + get { + object obj = ResourceManager.GetObject("ignore_once", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// diff --git a/Rubberduck.Resources/Inspections/InspectionsUI.resx b/Rubberduck.Resources/Inspections/InspectionsUI.resx index a2bd988b59..c02f4f7b46 100644 --- a/Rubberduck.Resources/Inspections/InspectionsUI.resx +++ b/Rubberduck.Resources/Inspections/InspectionsUI.resx @@ -205,4 +205,25 @@ ..\Icons\Fugue\block.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Icons\Fugue\balloon-prohibition.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + + Column + + + Component + + + Issue + + + Line + + + Project + + + Type + \ No newline at end of file From b11023403dafc44d8a59c94fc5627010bc682708 Mon Sep 17 00:00:00 2001 From: Max Doerner Date: Thu, 7 Feb 2019 19:42:41 +0100 Subject: [PATCH 20/26] Correct typos in comment in the parser grammar --- Rubberduck.Parsing/Grammar/VBAParser.g4 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Rubberduck.Parsing/Grammar/VBAParser.g4 b/Rubberduck.Parsing/Grammar/VBAParser.g4 index ef616e7a56..ce24613357 100644 --- a/Rubberduck.Parsing/Grammar/VBAParser.g4 +++ b/Rubberduck.Parsing/Grammar/VBAParser.g4 @@ -580,9 +580,9 @@ subscript : (expression whiteSpace TO whiteSpace)? expression; unrestrictedIdentifier : identifier | statementKeyword | markerKeyword; legalLabelIdentifier : { !(new[]{DOEVENTS,END,CLOSE,ELSE,LOOP,NEXT,RANDOMIZE,REM,RESUME,RETURN,STOP,WEND}).Contains(_input.La(1))}? identifier | markerKeyword; //The predicate in the following rule has been introduced to lessen the problem that VBA uses the same characters used as type hints in other syntactical constructs, -//e.g. in the bang notation (see withDictionaryAccessExpr). Generally, it is not legal to have an identifier of openeing bracket follow immediately after a type hint. -//The first part of the predicate tries to exclude these two situations. Unfortunately, predicates have to be at the start of a rule. S, an assumprion about the number -//of tokens in the identifier is made. All untypedIdentifers not a foreignNames consist of exactly one token and a typedIdentifier is an untypes one followed by a typeHint, +//e.g. in the bang notation (see withDictionaryAccessExpr). Generally, it is not legal to have an identifier or opening bracket follow immediately after a type hint. +//The first part of the predicate tries to exclude these two situations. Unfortunately, predicates have to be at the start of a rule. So, an assumption about the number +//of tokens in the identifier is made. All untypedIdentifers not a foreignNames consist of exactly one token and a typedIdentifier is an untyped one followed by a typeHint, //again a single token. So, in the majority of situations, the third token is the token following the potential type hint. //For foreignNames, no assumption can be made because they consist of a pair of brackets containing arbitrarily many tokens. //That is why the second part of the predicate looks at the first character in order to determine whether the identifier is a foreignName. From f4803254818d2b8f55bd700bf531d150764f3e31 Mon Sep 17 00:00:00 2001 From: bclothier Date: Fri, 8 Feb 2019 17:45:45 -0600 Subject: [PATCH 21/26] Fix the path - should be `%APPDATA%`, not `%APP_DATA%` --- .github/ISSUE_TEMPLATE/bug_report.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index c642490be6..dea6484dbf 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -33,7 +33,7 @@ A clear and concise description of what you expected to happen. If applicable, add screenshots to help explain your problem. **Logfile** -Rubberduck generates extensive logging in TRACE-Level. If no log was created at `%APP_DATA%\Rubberduck\Logs`, check your settings. Include this Log for bugreports about the behavior of Rubbberduck +Rubberduck generates extensive logging in TRACE-Level. If no log was created at `%APPDATA%\Rubberduck\Logs`, check your settings. Include this Log for bugreports about the behavior of Rubbberduck **Additional context** Add any other context about the problem here. From e413928341dd0cce72f77df6b6bfb67e14e2eb5b Mon Sep 17 00:00:00 2001 From: Mathieu Guindon Date: Sun, 10 Feb 2019 22:41:54 -0500 Subject: [PATCH 22/26] rephrase wording --- Rubberduck.Resources/RubberduckUI.Designer.cs | 67 +++++++++---------- 1 file changed, 32 insertions(+), 35 deletions(-) diff --git a/Rubberduck.Resources/RubberduckUI.Designer.cs b/Rubberduck.Resources/RubberduckUI.Designer.cs index e627a5254e..9aa37c5db3 100644 --- a/Rubberduck.Resources/RubberduckUI.Designer.cs +++ b/Rubberduck.Resources/RubberduckUI.Designer.cs @@ -136,23 +136,23 @@ public class RubberduckUI { } /// - /// Looks up a localized string similar to No references were found for project reference '{0}'.. + /// Looks up a localized string similar to No uses were found for project reference '{0}'.. /// public static string AllReferences_NoneFoundReference { get { return ResourceManager.GetString("AllReferences_NoneFoundReference", resourceCulture); } } - + /// - /// Looks up a localized string similar to Search for reference '{0}' returned {1} uses. Displaying the references may negatively impact performance. Continue?. + /// Looks up a localized string similar to Search for uses of reference '{0}' has returned {1} results. Displaying them may negatively impact performance. Continue?. /// public static string AllReferences_PerformanceWarning { get { return ResourceManager.GetString("AllReferences_PerformanceWarning", resourceCulture); } } - + /// /// Looks up a localized string similar to Apply. /// @@ -1620,7 +1620,7 @@ public class RubberduckUI { } /// - /// Looks up a localized string similar to Set DPI Unaware. + /// Looks up a localized string similar to Correction for high-resolution display scalings. /// public static string GeneralSettings_SetDpiUnaware { get { @@ -1681,7 +1681,7 @@ public class RubberduckUI { return ResourceManager.GetString("Go", resourceCulture); } } - + /// /// Looks up a localized string similar to Filter. /// @@ -1690,7 +1690,7 @@ public class RubberduckUI { return ResourceManager.GetString("GroupingGrid_Filter", resourceCulture); } } - + /// /// Looks up a localized string similar to Filter by. /// @@ -1744,16 +1744,16 @@ public class RubberduckUI { return ResourceManager.GetString("GroupingStyle_ByMarker", resourceCulture); } } - + /// - /// Looks up a localized string similar to By name. + /// Looks up a localized string similar to By inspection. /// public static string GroupingStyle_ByName { get { return ResourceManager.GetString("GroupingStyle_ByName", resourceCulture); } } - + /// /// Looks up a localized string similar to By outcome. /// @@ -1762,7 +1762,7 @@ public class RubberduckUI { return ResourceManager.GetString("GroupingStyle_ByOutcome", resourceCulture); } } - + /// /// Looks up a localized string similar to By severity. /// @@ -1771,7 +1771,7 @@ public class RubberduckUI { return ResourceManager.GetString("GroupingStyle_BySeverity", resourceCulture); } } - + /// /// Looks up a localized string similar to Home. /// @@ -2090,25 +2090,25 @@ public class RubberduckUI { return ResourceManager.GetString("Inspect", resourceCulture); } } - + /// /// Looks up a localized string similar to Collapse all. /// - public static string InspectionSettings_CollapseAll { + public static string InspectionResults_CollapseAll { get { - return ResourceManager.GetString("InspectionSettings_CollapseAll", resourceCulture); + return ResourceManager.GetString("InspectionResults_CollapseAll", resourceCulture); } } - + /// /// Looks up a localized string similar to Expand all. /// - public static string InspectionSettings_ExpandAll { + public static string InspectionResults_ExpandAll { get { - return ResourceManager.GetString("InspectionSettings_ExpandAll", resourceCulture); + return ResourceManager.GetString("InspectionResults_ExpandAll", resourceCulture); } } - + /// /// Looks up a localized string similar to Error. /// @@ -2310,37 +2310,34 @@ public class RubberduckUI { return ResourceManager.GetString("MakeActiveWorkbookReferenceExplicit", resourceCulture); } } - + /// - /// Looks up a localized string similar to Make ActiveWorkbook reference explicit. + /// Looks up a localized string similar to Member Attribute Recovery Failure . /// - public static string MemberAttributeRecoveryFailureCaption - { + public static string MemberAttributeRecoveryFailureCaption { get { return ResourceManager.GetString("MemberAttributeRecoveryFailureCaption", resourceCulture); } } - + /// - /// Looks up a localized string similar to Make ActiveWorkbook reference explicit. + /// Looks up a localized string similar to Member attributes for the following modules could not be recovered because they could no longer be found. {0}. /// - public static string MemberAttributeRecoveryMembersNotFoundMessage - { + public static string MemberAttributeRecoveryMembersNotFoundMessage { get { return ResourceManager.GetString("MemberAttributeRecoveryMembersNotFoundMessage", resourceCulture); } } - + /// - /// Looks up a localized string similar to Make ActiveWorkbook reference explicit. + /// Looks up a localized string similar to Failed to recover member attributes.. /// - public static string MemberAttributeRecoveryRewriteFailedMessage - { + public static string MemberAttributeRecoveryRewriteFailedMessage { get { return ResourceManager.GetString("MemberAttributeRecoveryRewriteFailedMessage", resourceCulture); } } - + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -2695,14 +2692,14 @@ public static string MemberAttributeRecoveryRewriteFailedMessage } /// - /// Looks up a localized string similar to PerformanceWarningCaption. + /// Looks up a localized string similar to Performance Warning. /// public static string PerformanceWarningCaption { get { return ResourceManager.GetString("PerformanceWarningCaption", resourceCulture); } } - + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -2967,7 +2964,7 @@ public static string MemberAttributeRecoveryRewriteFailedMessage } /// - /// Looks up a localized string similar to Word Documents({0})|{0}. + /// Looks up a localized string similar to Word Documents ({0})|{0}. /// public static string References_BrowseFilterWord { get { From dfb58ef756150bb2ae1362b4167f6553ab08e2a4 Mon Sep 17 00:00:00 2001 From: Mathieu Guindon Date: Sun, 10 Feb 2019 23:06:47 -0500 Subject: [PATCH 23/26] fixes #4629 --- .../SelfClosingPairs/SelfClosingPairHandler.cs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/Rubberduck.Core/AutoComplete/SelfClosingPairs/SelfClosingPairHandler.cs b/Rubberduck.Core/AutoComplete/SelfClosingPairs/SelfClosingPairHandler.cs index 968812efb9..e5ee91eb26 100644 --- a/Rubberduck.Core/AutoComplete/SelfClosingPairs/SelfClosingPairHandler.cs +++ b/Rubberduck.Core/AutoComplete/SelfClosingPairs/SelfClosingPairHandler.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using System.Linq; using Rubberduck.Settings; using Rubberduck.VBEditor; @@ -130,14 +131,21 @@ private bool HandleInternal(AutoCompleteEventArgs e, CodeString original, SelfCl } var reprettified = CodePaneHandler.Prettify(e.Module, result); - if (pair.OpeningChar == '(' && e.Character == pair.OpeningChar && !reprettified.Equals(result)) + if (pair.OpeningChar == '(' && e.Character == pair.OpeningChar) { + if (string.Equals(reprettified.Code, result.Code, StringComparison.InvariantCultureIgnoreCase)) + { + e.Handled = true; + result = reprettified; + return true; + } + // VBE eats it. bail out but don't swallow the keypress. e.Handled = false; result = null; return false; } - + var currentLine = reprettified.Lines[reprettified.CaretPosition.StartLine]; if (!string.IsNullOrWhiteSpace(currentLine) && currentLine.EndsWith(" ") && From 639c324d70a60b148d290bfe2b3a084d253f0d4a Mon Sep 17 00:00:00 2001 From: Mathieu Guindon Date: Sun, 10 Feb 2019 23:26:40 -0500 Subject: [PATCH 24/26] fixes #4631 --- .../AutoComplete/SelfClosingPairs/SelfClosingPairHandler.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Rubberduck.Core/AutoComplete/SelfClosingPairs/SelfClosingPairHandler.cs b/Rubberduck.Core/AutoComplete/SelfClosingPairs/SelfClosingPairHandler.cs index e5ee91eb26..c1e06761fa 100644 --- a/Rubberduck.Core/AutoComplete/SelfClosingPairs/SelfClosingPairHandler.cs +++ b/Rubberduck.Core/AutoComplete/SelfClosingPairs/SelfClosingPairHandler.cs @@ -124,6 +124,12 @@ private bool HandleInternal(AutoCompleteEventArgs e, CodeString original, SelfCl ); } + if (original.CaretLine.EndsWith(" ") && + string.Equals(original.CaretLine, prettified.CaretLine + " ", StringComparison.InvariantCultureIgnoreCase)) + { + prettified = original; + } + // if executing the SCP against the prettified code yields no result, we need to bail out. if (!_scpService.Execute(pair, prettified, e.Character, out result)) { From e39988da5ec8a3577731a20d25694d780ed3112c Mon Sep 17 00:00:00 2001 From: Mathieu Guindon Date: Sun, 10 Feb 2019 23:53:50 -0500 Subject: [PATCH 25/26] fixes broken test --- RubberduckTests/AutoComplete/SelfClosingPairHandlerTests.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RubberduckTests/AutoComplete/SelfClosingPairHandlerTests.cs b/RubberduckTests/AutoComplete/SelfClosingPairHandlerTests.cs index bfeb4301b7..e11d0659c6 100644 --- a/RubberduckTests/AutoComplete/SelfClosingPairHandlerTests.cs +++ b/RubberduckTests/AutoComplete/SelfClosingPairHandlerTests.cs @@ -44,14 +44,14 @@ public void GivenValidInput_InvokesSCP() } [Test] - public void GivenOpeningParenthesisOnOtherwiseNonEmptyLine_ReturnsFalseAndSwallowsKeypress() + public void GivenOpeningParenthesisOnOtherwiseNonEmptyLine_ReturnsTrueAndSwallowsKeypress() { var input = '('; var original = "foo = DateSerial(Year|)".ToCodeString(); var rePrettified = "foo = DateSerial(Year(|))".ToCodeString(); var info = new SelfClosingPairTestInfo(original, input, rePrettified); - Assert.IsFalse(Run(info)); + Assert.IsTrue(Run(info)); Assert.IsTrue(info.Args.Handled); } From fbf56899ef6315a88bcbee94d732c71ceeffc1ba Mon Sep 17 00:00:00 2001 From: Mathieu Guindon Date: Mon, 11 Feb 2019 00:05:33 -0500 Subject: [PATCH 26/26] removed block completion settings --- Rubberduck.Core/UI/Settings/AutoCompleteSettings.xaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Rubberduck.Core/UI/Settings/AutoCompleteSettings.xaml b/Rubberduck.Core/UI/Settings/AutoCompleteSettings.xaml index dcf70c8995..9a329b7a63 100644 --- a/Rubberduck.Core/UI/Settings/AutoCompleteSettings.xaml +++ b/Rubberduck.Core/UI/Settings/AutoCompleteSettings.xaml @@ -130,6 +130,7 @@ MaxNumber="{Binding Path=DataContext.ConcatMaxLinesMaxValue, RelativeSource={RelativeSource Self}}"> --> +