From 3e57cd13c6ca216a5702836cd0e6bdbe72aab822 Mon Sep 17 00:00:00 2001 From: Dennis Daume Date: Sat, 23 Apr 2016 20:54:57 +0200 Subject: [PATCH 01/31] Don't compile the comment regex, because we only use every instance a single time This speeds up the comment formatting a gazillion times --- CodeMaid/Helpers/CodeCommentHelper.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CodeMaid/Helpers/CodeCommentHelper.cs b/CodeMaid/Helpers/CodeCommentHelper.cs index b050861e..bb1887c4 100644 --- a/CodeMaid/Helpers/CodeCommentHelper.cs +++ b/CodeMaid/Helpers/CodeCommentHelper.cs @@ -141,7 +141,7 @@ internal static Regex GetCommentRegex(CodeLanguage codeLanguage, bool includePre } var pattern = string.Format(@"^{0}(?(?[\t ]*)(?[-=\*\+]+[ \t]*|\w+[\):][ \t]+|\d+\.[ \t]+)?((?[^\t\r\n ]+)*[\t ]*)*)[\r]*[\n]?$", prefix); - return new Regex(pattern, RegexOptions.Compiled | RegexOptions.ExplicitCapture | RegexOptions.Multiline); + return new Regex(pattern, RegexOptions.ExplicitCapture | RegexOptions.Multiline); } internal static int GetTabSize(CodeMaidPackage package, TextDocument document) From 7bbaf152a24659fcbadd2aff699b56bf08eb8f48 Mon Sep 17 00:00:00 2001 From: Steve Cadwallader Date: Sat, 14 May 2016 06:41:04 -0400 Subject: [PATCH 02/31] #290: Extend FindInSolutionExplorerCommand to more gracefully handle when Track Active Item is selected. --- CodeMaid/Helpers/CommandHelper.cs | 11 +++++++ .../Commands/FindInSolutionExplorerCommand.cs | 30 +++++++++++++++---- 2 files changed, 35 insertions(+), 6 deletions(-) diff --git a/CodeMaid/Helpers/CommandHelper.cs b/CodeMaid/Helpers/CommandHelper.cs index b8edf080..10ae1982 100644 --- a/CodeMaid/Helpers/CommandHelper.cs +++ b/CodeMaid/Helpers/CommandHelper.cs @@ -56,6 +56,17 @@ public Command FindCommand(params string[] commandNames) return _package.IDE.Commands.OfType().FirstOrDefault(x => commandNames.Contains(x.Name)); } + /// + /// Finds a command by the specified guid/id pair. + /// + /// The command guid. + /// The command id. + /// The found command, otherwise null. + public Command FindCommand(string guid, int id) + { + return _package.IDE.Commands.OfType().FirstOrDefault(x => x.Guid == guid && x.ID == id); + } + #endregion Methods } } \ No newline at end of file diff --git a/CodeMaid/Integration/Commands/FindInSolutionExplorerCommand.cs b/CodeMaid/Integration/Commands/FindInSolutionExplorerCommand.cs index 18b9918a..67841698 100644 --- a/CodeMaid/Integration/Commands/FindInSolutionExplorerCommand.cs +++ b/CodeMaid/Integration/Commands/FindInSolutionExplorerCommand.cs @@ -11,6 +11,12 @@ namespace SteveCadwallader.CodeMaid.Integration.Commands /// internal class FindInSolutionExplorerCommand : BaseCommand { + #region Fields + + private readonly CommandHelper _commandHelper; + + #endregion Fields + #region Constructors /// @@ -21,6 +27,7 @@ internal FindInSolutionExplorerCommand(CodeMaidPackage package) : base(package, new CommandID(PackageGuids.GuidCodeMaidCommandFindInSolutionExplorer, PackageIds.CmdIDCodeMaidFindInSolutionExplorer)) { + _commandHelper = CommandHelper.GetInstance(package); } #endregion Constructors @@ -50,12 +57,23 @@ protected override void OnExecute() ToggleSolutionFoldersOpenTemporarily(UIHierarchyHelper.GetTopUIHierarchyItem(Package)); } - //Note: Instead of directly invoking the command by name, we are using the GUID/ID pair. - // This is a workaround for the canonical name being undefined in Spanish versions of Visual Studio. - object customIn = null; - object customOut = null; - Package.IDE.Commands.Raise("{D63DB1F0-404E-4B21-9648-CA8D99245EC3}", 36, ref customIn, ref customOut); - //Package.IDE.ExecuteCommand("SolutionExplorer.SyncWithActiveDocument", String.Empty); + // Instead of directly using "SolutionExplorer.SyncWithActiveDocument" we are using + // the GUID/ID pair. This is a workaround for the canonical name being undefined in + // Spanish versions of Visual Studio. + var command = _commandHelper.FindCommand("{D63DB1F0-404E-4B21-9648-CA8D99245EC3}", 36); + if (command != null && command.IsAvailable) + { + object customIn = null; + object customOut = null; + Package.IDE.Commands.Raise(command.Guid, command.ID, ref customIn, ref customOut); + } + else + { + // The command will be unavailable if track active item is selected, and in those + // scenarios we just want to activate the solution explorer since the right item + // will already be highlighted. + Package.IDE.ExecuteCommand("View.SolutionExplorer", string.Empty); + } } } From 00460f392440a5b29d8b19014235c04a889400fc Mon Sep 17 00:00:00 2001 From: Steve Cadwallader Date: Wed, 17 Aug 2016 20:50:54 -0400 Subject: [PATCH 03/31] #326: Fix for how VB DocComment's are parsed vs. C# DocComment's. --- CodeMaid/UI/Converters/DocCommentToStringConverter.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CodeMaid/UI/Converters/DocCommentToStringConverter.cs b/CodeMaid/UI/Converters/DocCommentToStringConverter.cs index 5e9d1832..f1464aae 100644 --- a/CodeMaid/UI/Converters/DocCommentToStringConverter.cs +++ b/CodeMaid/UI/Converters/DocCommentToStringConverter.cs @@ -33,7 +33,7 @@ public object Convert(object value, Type targetType, object parameter, System.Gl { var xElement = XElement.Parse(str); - var summaryTag = xElement.Descendants("summary").FirstOrDefault(); + var summaryTag = xElement.DescendantsAndSelf("summary").FirstOrDefault(); if (summaryTag == null) return string.Empty; // Get the Inner XML for the summary tag. From 9b3d46648d144c0a85022782d4413386d18319f8 Mon Sep 17 00:00:00 2001 From: Samuel Cragg Date: Tue, 13 Sep 2016 07:13:48 +0100 Subject: [PATCH 04/31] Fix sorting of explicit interface members When sorting, interface members are now checked if they are explicit implementations and, if so, will only use the member name when performing a name sort (i.e. IInterface.Method will be normalized to Method) --- CodeMaid.UnitTests/CodeMaid.UnitTests.csproj | 26 +++++++ .../Helpers/CodeItemTypeComparerTests.cs | 77 +++++++++++++++++++ CodeMaid.UnitTests/packages.config | 4 + CodeMaid/CodeMaid.csproj | 1 + CodeMaid/Helpers/CodeItemTypeComparer.cs | 49 +++++++++--- .../Reorganizing/CodeReorganizationManager.cs | 5 +- CodeMaid/Model/CodeItems/CodeItemEvent.cs | 2 +- CodeMaid/Model/CodeItems/CodeItemMethod.cs | 2 +- CodeMaid/Model/CodeItems/CodeItemProperty.cs | 2 +- CodeMaid/Model/CodeItems/IInterfaceItem.cs | 13 ++++ CodeMaid/Model/CodeTree/CodeTreeBuilder.cs | 3 +- 11 files changed, 168 insertions(+), 16 deletions(-) create mode 100644 CodeMaid.UnitTests/Helpers/CodeItemTypeComparerTests.cs create mode 100644 CodeMaid.UnitTests/packages.config create mode 100644 CodeMaid/Model/CodeItems/IInterfaceItem.cs diff --git a/CodeMaid.UnitTests/CodeMaid.UnitTests.csproj b/CodeMaid.UnitTests/CodeMaid.UnitTests.csproj index 05829ade..76d3c141 100644 --- a/CodeMaid.UnitTests/CodeMaid.UnitTests.csproj +++ b/CodeMaid.UnitTests/CodeMaid.UnitTests.csproj @@ -80,11 +80,35 @@ False ..\lib\Microsoft.VSSDK.UnitTestLibrary.dll + + ..\packages\NSubstitute.1.10.0.0\lib\net45\NSubstitute.dll + True + + + + {80CC9F66-E7D8-4DDD-85B6-D9E6CD0E93E2} + 8 + 0 + 0 + primary + False + False + + + {1A31287A-4D7D-413E-8E32-3B374931BD89} + 8 + 0 + 0 + primary + False + False + + Properties\GlobalAssemblyInfo.cs @@ -97,6 +121,7 @@ + @@ -116,6 +141,7 @@ Properties\CodeMaid.snk + diff --git a/CodeMaid.UnitTests/Helpers/CodeItemTypeComparerTests.cs b/CodeMaid.UnitTests/Helpers/CodeItemTypeComparerTests.cs new file mode 100644 index 00000000..3f5f50a8 --- /dev/null +++ b/CodeMaid.UnitTests/Helpers/CodeItemTypeComparerTests.cs @@ -0,0 +1,77 @@ +using EnvDTE80; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using NSubstitute; +using SteveCadwallader.CodeMaid.Helpers; +using SteveCadwallader.CodeMaid.Model.CodeItems; + +namespace SteveCadwallader.CodeMaid.UnitTests.Helpers +{ + [TestClass] + public class CodeItemTypeComparerTests + { + [TestMethod] + public void ShouldSortItemsOfTheSameTypeByName() + { + BaseCodeItem itemB = Create("b", 1); + BaseCodeItem itemA = Create("a", 2); + var comparer = new CodeItemTypeComparer(sortByName: true); + + int result = comparer.Compare(itemA, itemB); + + Assert.IsTrue(result < 0); + } + + [TestMethod] + public void ShouldSortItemsOfTheSameTypeByOffset() + { + BaseCodeItem itemB = Create("b", 1); + BaseCodeItem itemA = Create("a", 2); + var comparer = new CodeItemTypeComparer(sortByName: false); + + int result = comparer.Compare(itemA, itemB); + + Assert.IsTrue(result > 0); + } + + [TestMethod] + public void ShouldSortByGroupType() + { + BaseCodeItem method = Create("a", 1); + BaseCodeItem field = Create("z", 2); + var comparer = new CodeItemTypeComparer(sortByName: true); + + int result = comparer.Compare(field, method); + + Assert.IsTrue(result < 0); + } + + [TestMethod] + public void ShouldSortByExplicitInterfaceMemberName() + { + CodeItemMethod methodB = CreateExplicitMethod("Interface", "Z", 1); + BaseCodeItem methodA = Create("X", 2); + var comparer = new CodeItemTypeComparer(sortByName: true); + + int result = comparer.Compare(methodA, methodB); + + Assert.IsTrue(result < 0); + } + + private static T Create(string name, int offset) where T : BaseCodeItem, new() + { + return new T + { + Name = name, + StartOffset = offset + }; + } + + private static CodeItemMethod CreateExplicitMethod(string interfaceName, string methodName, int offset) + { + CodeItemMethod method = Create(interfaceName + "." + methodName, offset); + method.CodeFunction = Substitute.For(); + method.CodeFunction.Name = method.Name; + return method; + } + } +} diff --git a/CodeMaid.UnitTests/packages.config b/CodeMaid.UnitTests/packages.config new file mode 100644 index 00000000..04628968 --- /dev/null +++ b/CodeMaid.UnitTests/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/CodeMaid/CodeMaid.csproj b/CodeMaid/CodeMaid.csproj index cc83e37a..2ea0f0df 100644 --- a/CodeMaid/CodeMaid.csproj +++ b/CodeMaid/CodeMaid.csproj @@ -206,6 +206,7 @@ + diff --git a/CodeMaid/Helpers/CodeItemTypeComparer.cs b/CodeMaid/Helpers/CodeItemTypeComparer.cs index 545303e9..7d1233af 100644 --- a/CodeMaid/Helpers/CodeItemTypeComparer.cs +++ b/CodeMaid/Helpers/CodeItemTypeComparer.cs @@ -1,7 +1,7 @@ +using System.Collections.Generic; using EnvDTE; using SteveCadwallader.CodeMaid.Model.CodeItems; using SteveCadwallader.CodeMaid.Properties; -using System.Collections.Generic; namespace SteveCadwallader.CodeMaid.Helpers { @@ -10,6 +10,25 @@ namespace SteveCadwallader.CodeMaid.Helpers /// public class CodeItemTypeComparer : Comparer { + #region Fields + + private readonly bool _sortByName; + + #endregion Fields + + #region Constructors + + /// + /// Initializes a new instance of the class. + /// + /// Determines whether a secondary sort by name is performed or not. + public CodeItemTypeComparer(bool sortByName) + { + _sortByName = sortByName; + } + + #endregion Constructors + #region Methods /// @@ -31,9 +50,9 @@ public override int Compare(BaseCodeItem x, BaseCodeItem y) if (first == second) { // Check if secondary sort by name should occur. - if (Settings.Default.Digging_SecondarySortTypeByName) + if (_sortByName) { - int nameComparison = x.Name.CompareTo(y.Name); + int nameComparison = NormalizeName(x).CompareTo(NormalizeName(y)); if (nameComparison != 0) { return nameComparison; @@ -47,12 +66,7 @@ public override int Compare(BaseCodeItem x, BaseCodeItem y) return first.CompareTo(second); } - /// - /// Calculates an ordered numeric representation of the specified code item. - /// - /// The code item. - /// A numeric representation. - public static int CalculateNumericRepresentation(BaseCodeItem codeItem) + private static int CalculateNumericRepresentation(BaseCodeItem codeItem) { int typeOffset = CalculateTypeOffset(codeItem); int accessOffset = CalculateAccessOffset(codeItem); @@ -139,6 +153,23 @@ private static int CalculateReadOnlyOffset(BaseCodeItem codeItem) return codeItemField.IsReadOnly ? 0 : 1; } + private static string NormalizeName(BaseCodeItem codeItem) + { + string name = codeItem.Name; + var interfaceItem = codeItem as IInterfaceItem; + if ((interfaceItem != null) && interfaceItem.IsExplicitInterfaceImplementation) + { + // Try to find where the interface ends and the method starts + int dot = name.LastIndexOf('.') + 1; + if ((dot > 0) && (dot < name.Length)) + { + return name.Substring(dot); + } + } + + return name; + } + #endregion Methods } } \ No newline at end of file diff --git a/CodeMaid/Logic/Reorganizing/CodeReorganizationManager.cs b/CodeMaid/Logic/Reorganizing/CodeReorganizationManager.cs index ada6b3ce..8a825a04 100644 --- a/CodeMaid/Logic/Reorganizing/CodeReorganizationManager.cs +++ b/CodeMaid/Logic/Reorganizing/CodeReorganizationManager.cs @@ -364,9 +364,8 @@ private void RecursivelyReorganize(IEnumerable codeItems, ICodeIte // Get the items in their current order and their desired order. var currentOrder = GetReorganizableCodeItemElements(codeItems); - var desiredOrder = currentOrder.OrderBy(CodeItemTypeComparer.CalculateNumericRepresentation) - .ThenBy(x => Settings.Default.Reorganizing_AlphabetizeMembersOfTheSameGroup ? (object)x.Name : (object)x.StartOffset) - .ToList(); + var desiredOrder = new List(currentOrder); + desiredOrder.Sort(new CodeItemTypeComparer(Settings.Default.Reorganizing_AlphabetizeMembersOfTheSameGroup)); // Iterate across the items in the desired order, moving them when necessary. for (int desiredIndex = 0; desiredIndex < desiredOrder.Count; desiredIndex++) diff --git a/CodeMaid/Model/CodeItems/CodeItemEvent.cs b/CodeMaid/Model/CodeItems/CodeItemEvent.cs index a57a2cc6..78003dc6 100644 --- a/CodeMaid/Model/CodeItems/CodeItemEvent.cs +++ b/CodeMaid/Model/CodeItems/CodeItemEvent.cs @@ -8,7 +8,7 @@ namespace SteveCadwallader.CodeMaid.Model.CodeItems /// /// The representation of a code event. /// - public class CodeItemEvent : BaseCodeItemElement + public class CodeItemEvent : BaseCodeItemElement, IInterfaceItem { #region Fields diff --git a/CodeMaid/Model/CodeItems/CodeItemMethod.cs b/CodeMaid/Model/CodeItems/CodeItemMethod.cs index 3993e0fa..d11909bf 100644 --- a/CodeMaid/Model/CodeItems/CodeItemMethod.cs +++ b/CodeMaid/Model/CodeItems/CodeItemMethod.cs @@ -10,7 +10,7 @@ namespace SteveCadwallader.CodeMaid.Model.CodeItems /// /// The representation of a code method. /// - public class CodeItemMethod : BaseCodeItemElement, ICodeItemComplexity, ICodeItemParameters + public class CodeItemMethod : BaseCodeItemElement, ICodeItemComplexity, ICodeItemParameters, IInterfaceItem { #region Fields diff --git a/CodeMaid/Model/CodeItems/CodeItemProperty.cs b/CodeMaid/Model/CodeItems/CodeItemProperty.cs index 67c29c27..8277b5c6 100644 --- a/CodeMaid/Model/CodeItems/CodeItemProperty.cs +++ b/CodeMaid/Model/CodeItems/CodeItemProperty.cs @@ -10,7 +10,7 @@ namespace SteveCadwallader.CodeMaid.Model.CodeItems /// /// The representation of a code property. /// - public class CodeItemProperty : BaseCodeItemElement, ICodeItemComplexity, ICodeItemParameters + public class CodeItemProperty : BaseCodeItemElement, ICodeItemComplexity, ICodeItemParameters, IInterfaceItem { #region Fields diff --git a/CodeMaid/Model/CodeItems/IInterfaceItem.cs b/CodeMaid/Model/CodeItems/IInterfaceItem.cs new file mode 100644 index 00000000..7a58cdb1 --- /dev/null +++ b/CodeMaid/Model/CodeItems/IInterfaceItem.cs @@ -0,0 +1,13 @@ +namespace SteveCadwallader.CodeMaid.Model.CodeItems +{ + /// + /// Represents an item that can implement an interface member. + /// + public interface IInterfaceItem + { + /// + /// Gets a flag indicating if this is an explicit interface implementation. + /// + bool IsExplicitInterfaceImplementation { get; } + } +} diff --git a/CodeMaid/Model/CodeTree/CodeTreeBuilder.cs b/CodeMaid/Model/CodeTree/CodeTreeBuilder.cs index bea28655..0774c0eb 100644 --- a/CodeMaid/Model/CodeTree/CodeTreeBuilder.cs +++ b/CodeMaid/Model/CodeTree/CodeTreeBuilder.cs @@ -1,5 +1,6 @@ using SteveCadwallader.CodeMaid.Helpers; using SteveCadwallader.CodeMaid.Model.CodeItems; +using SteveCadwallader.CodeMaid.Properties; using System; using System.Collections.Generic; using System.Linq; @@ -155,7 +156,7 @@ private static SetCodeItems OrganizeCodeItemsByTypeSortOrder(SetCodeItems rawCod organizedCodeItems.AddRange(structuredCodeItems); // Sort the list of code items by type recursively. - RecursivelySort(organizedCodeItems, new CodeItemTypeComparer()); + RecursivelySort(organizedCodeItems, new CodeItemTypeComparer(Settings.Default.Digging_SecondarySortTypeByName)); // Group the list of code items by type recursively. foreach (var codeItem in organizedCodeItems.OfType()) From b1872e1099c0b96ad3a1021401aa23bb6729901f Mon Sep 17 00:00:00 2001 From: Samuel Cragg Date: Tue, 13 Sep 2016 21:17:12 +0100 Subject: [PATCH 05/31] Add new reorganizing setting Allows the placing of explicit interface members at the end of their group to be specified with the options dialog --- CodeMaid/Properties/Settings.Designer.cs | 12 ++++++++++++ CodeMaid/Properties/Settings.settings | 3 +++ .../ReorganizingGeneralDataTemplate.xaml | 1 + .../Reorganizing/ReorganizingGeneralViewModel.cs | 10 ++++++++++ CodeMaid/app.config | 3 +++ 5 files changed, 29 insertions(+) diff --git a/CodeMaid/Properties/Settings.Designer.cs b/CodeMaid/Properties/Settings.Designer.cs index 2493a67e..30f81edb 100644 --- a/CodeMaid/Properties/Settings.Designer.cs +++ b/CodeMaid/Properties/Settings.Designer.cs @@ -1679,6 +1679,18 @@ public bool Reorganizing_AlphabetizeMembersOfTheSameGroup { } } + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("False")] + public bool Reorganizing_ExplicitMembersAtEnd { + get { + return ((bool)(this["Reorganizing_ExplicitMembersAtEnd"])); + } + set { + this["Reorganizing_ExplicitMembersAtEnd"] = value; + } + } + [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("True")] diff --git a/CodeMaid/Properties/Settings.settings b/CodeMaid/Properties/Settings.settings index 19b6b12e..6f2058dc 100644 --- a/CodeMaid/Properties/Settings.settings +++ b/CodeMaid/Properties/Settings.settings @@ -416,6 +416,9 @@ True + + False + True diff --git a/CodeMaid/UI/Dialogs/Options/Reorganizing/ReorganizingGeneralDataTemplate.xaml b/CodeMaid/UI/Dialogs/Options/Reorganizing/ReorganizingGeneralDataTemplate.xaml index 35be5d31..e18adc0e 100644 --- a/CodeMaid/UI/Dialogs/Options/Reorganizing/ReorganizingGeneralDataTemplate.xaml +++ b/CodeMaid/UI/Dialogs/Options/Reorganizing/ReorganizingGeneralDataTemplate.xaml @@ -9,6 +9,7 @@ + diff --git a/CodeMaid/UI/Dialogs/Options/Reorganizing/ReorganizingGeneralViewModel.cs b/CodeMaid/UI/Dialogs/Options/Reorganizing/ReorganizingGeneralViewModel.cs index 3fc76ba5..53ae8e32 100644 --- a/CodeMaid/UI/Dialogs/Options/Reorganizing/ReorganizingGeneralViewModel.cs +++ b/CodeMaid/UI/Dialogs/Options/Reorganizing/ReorganizingGeneralViewModel.cs @@ -21,6 +21,7 @@ public ReorganizingGeneralViewModel(CodeMaidPackage package, Settings activeSett Mappings = new SettingsToOptionsList(ActiveSettings, this) { new SettingToOptionMapping(x => ActiveSettings.Reorganizing_AlphabetizeMembersOfTheSameGroup, x => AlphabetizeMembersOfTheSameGroup), + new SettingToOptionMapping(x => ActiveSettings.Reorganizing_ExplicitMembersAtEnd, x => ExplicitInterfaceMembersAtTheEnd), new SettingToOptionMapping(x => ActiveSettings.Reorganizing_KeepMembersWithinRegions, x => KeepMembersWithinRegions), new SettingToOptionMapping(x => ActiveSettings.Reorganizing_PerformWhenPreprocessorConditionals, x => PerformWhenPreprocessorConditionals), new SettingToOptionMapping(x => ActiveSettings.Reorganizing_PrimaryOrderByAccessLevel, x => PrimaryOrderByAccessLevel), @@ -50,6 +51,15 @@ public bool AlphabetizeMembersOfTheSameGroup set { SetPropertyValue(value); } } + /// + /// Gets or sets the flag indicating if explicit interface members should be placed at the end of the group. + /// + public bool ExplicitInterfaceMembersAtTheEnd + { + get { return GetPropertyValue(); } + set { SetPropertyValue(value); } + } + /// /// Gets or sets the flag indicating if members should be kept within regions. /// diff --git a/CodeMaid/app.config b/CodeMaid/app.config index b0fe87db..a1950f9a 100644 --- a/CodeMaid/app.config +++ b/CodeMaid/app.config @@ -545,6 +545,9 @@ False + + False + From 4eadd78a088fe65481c361b4a577fd70359d38f4 Mon Sep 17 00:00:00 2001 From: Samuel Cragg Date: Tue, 13 Sep 2016 21:53:04 +0100 Subject: [PATCH 06/31] Sort explicit interface members at the end Explicit interface members will now be sorted at the end of their group if the setting is checked. --- .../Helpers/CodeItemTypeComparerTests.cs | 27 ++++++++++++++++--- CodeMaid/Helpers/CodeItemTypeComparer.cs | 25 +++++++++++++---- CodeMaid/app.config | 6 ++--- 3 files changed, 47 insertions(+), 11 deletions(-) diff --git a/CodeMaid.UnitTests/Helpers/CodeItemTypeComparerTests.cs b/CodeMaid.UnitTests/Helpers/CodeItemTypeComparerTests.cs index 3f5f50a8..f8471836 100644 --- a/CodeMaid.UnitTests/Helpers/CodeItemTypeComparerTests.cs +++ b/CodeMaid.UnitTests/Helpers/CodeItemTypeComparerTests.cs @@ -3,12 +3,19 @@ using NSubstitute; using SteveCadwallader.CodeMaid.Helpers; using SteveCadwallader.CodeMaid.Model.CodeItems; +using SteveCadwallader.CodeMaid.Properties; namespace SteveCadwallader.CodeMaid.UnitTests.Helpers { [TestClass] public class CodeItemTypeComparerTests { + [TestInitialize] + public void TestInitialize() + { + Settings.Default.Reset(); + } + [TestMethod] public void ShouldSortItemsOfTheSameTypeByName() { @@ -48,11 +55,25 @@ public void ShouldSortByGroupType() [TestMethod] public void ShouldSortByExplicitInterfaceMemberName() { - CodeItemMethod methodB = CreateExplicitMethod("Interface", "Z", 1); - BaseCodeItem methodA = Create("X", 2); + CodeItemMethod methodZ = CreateExplicitMethod("Interface", "Z", 1); + BaseCodeItem methodX = Create("X", 2); + var comparer = new CodeItemTypeComparer(sortByName: true); + + Settings.Default.Reorganizing_ExplicitMembersAtEnd = false; + int result = comparer.Compare(methodX, methodZ); + + Assert.IsTrue(result < 0); + } + + [TestMethod] + public void ShouldPlaceExplicitInterfaceMembersAtTheEndOfTheGroup() + { + CodeItemMethod methodA = CreateExplicitMethod("Interface", "A", 1); + BaseCodeItem methodB = Create("B", 2); var comparer = new CodeItemTypeComparer(sortByName: true); - int result = comparer.Compare(methodA, methodB); + Settings.Default.Reorganizing_ExplicitMembersAtEnd = true; + int result = comparer.Compare(methodB, methodA); Assert.IsTrue(result < 0); } diff --git a/CodeMaid/Helpers/CodeItemTypeComparer.cs b/CodeMaid/Helpers/CodeItemTypeComparer.cs index 7d1233af..0d18a639 100644 --- a/CodeMaid/Helpers/CodeItemTypeComparer.cs +++ b/CodeMaid/Helpers/CodeItemTypeComparer.cs @@ -70,6 +70,7 @@ private static int CalculateNumericRepresentation(BaseCodeItem codeItem) { int typeOffset = CalculateTypeOffset(codeItem); int accessOffset = CalculateAccessOffset(codeItem); + int explicitOffset = CalculateExplicitInterfaceOffset(codeItem); int constantOffset = CalculateConstantOffset(codeItem); int staticOffset = CalculateStaticOffset(codeItem); int readOnlyOffset = CalculateReadOnlyOffset(codeItem); @@ -78,16 +79,16 @@ private static int CalculateNumericRepresentation(BaseCodeItem codeItem) if (!Settings.Default.Reorganizing_PrimaryOrderByAccessLevel) { - calc += typeOffset * 10000; - calc += accessOffset * 1000; + calc += typeOffset * 100000; + calc += accessOffset * 10000; } else { - calc += accessOffset * 10000; - calc += typeOffset * 1000; + calc += accessOffset * 100000; + calc += typeOffset * 10000; } - calc += (constantOffset * 100) + (staticOffset * 10) + readOnlyOffset; + calc += (explicitOffset * 1000) + (constantOffset * 100) + (staticOffset * 10) + readOnlyOffset; return calc; } @@ -137,6 +138,20 @@ private static int CalculateConstantOffset(BaseCodeItem codeItem) return codeItemField.IsConstant ? 0 : 1; } + private static int CalculateExplicitInterfaceOffset(BaseCodeItem codeItem) + { + if (Settings.Default.Reorganizing_ExplicitMembersAtEnd) + { + var interfaceItem = codeItem as IInterfaceItem; + if ((interfaceItem != null) && interfaceItem.IsExplicitInterfaceImplementation) + { + return 1; + } + } + + return 0; + } + private static int CalculateStaticOffset(BaseCodeItem codeItem) { var codeItemElement = codeItem as BaseCodeItemElement; diff --git a/CodeMaid/app.config b/CodeMaid/app.config index a1950f9a..40b2bb03 100644 --- a/CodeMaid/app.config +++ b/CodeMaid/app.config @@ -469,6 +469,9 @@ serializeAs="String"> True + + False + True @@ -545,9 +548,6 @@ False - - False - From 3aea33ea51514b7c2b5ca994dce80debef89c05c Mon Sep 17 00:00:00 2001 From: Steve Cadwallader Date: Wed, 14 Sep 2016 20:48:14 -0400 Subject: [PATCH 07/31] Experiment with explicit nuget restore command in appveyor.yml based on https://www.appveyor.com/blog/2014/03/18/about-nuget-package-restore/ --- appveyor.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/appveyor.yml b/appveyor.yml index 69253f04..4a33f2b4 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -12,6 +12,7 @@ assembly_info: assembly_informational_version: '{version}' before_build: + - nuget restore - ps: Vsix-IncrementVsixVersion | Vsix-UpdateBuildVersion - ps: Vsix-TokenReplacement CodeMaid\source.extension.cs 'Version = "([0-9\\.]+)"' 'Version = "{version}"' From 446a9ba16c297ee53d69cbdada3016518c7d9e19 Mon Sep 17 00:00:00 2001 From: Samuel Cragg Date: Thu, 15 Sep 2016 06:38:38 +0100 Subject: [PATCH 08/31] Code review tweaks Minor readability tweaks: * Moved using statement so they're alphabetical * Moved CalculateConstantOffset so it's in the same order it's called * Improved readability of the range check for the explicit interface member name --- CodeMaid/Helpers/CodeItemTypeComparer.cs | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/CodeMaid/Helpers/CodeItemTypeComparer.cs b/CodeMaid/Helpers/CodeItemTypeComparer.cs index 0d18a639..891fd1e8 100644 --- a/CodeMaid/Helpers/CodeItemTypeComparer.cs +++ b/CodeMaid/Helpers/CodeItemTypeComparer.cs @@ -1,7 +1,7 @@ -using System.Collections.Generic; using EnvDTE; using SteveCadwallader.CodeMaid.Model.CodeItems; using SteveCadwallader.CodeMaid.Properties; +using System.Collections.Generic; namespace SteveCadwallader.CodeMaid.Helpers { @@ -130,14 +130,6 @@ private static int CalculateAccessOffset(BaseCodeItem codeItem) } } - private static int CalculateConstantOffset(BaseCodeItem codeItem) - { - var codeItemField = codeItem as CodeItemField; - if (codeItemField == null) return 0; - - return codeItemField.IsConstant ? 0 : 1; - } - private static int CalculateExplicitInterfaceOffset(BaseCodeItem codeItem) { if (Settings.Default.Reorganizing_ExplicitMembersAtEnd) @@ -152,6 +144,14 @@ private static int CalculateExplicitInterfaceOffset(BaseCodeItem codeItem) return 0; } + private static int CalculateConstantOffset(BaseCodeItem codeItem) + { + var codeItemField = codeItem as CodeItemField; + if (codeItemField == null) return 0; + + return codeItemField.IsConstant ? 0 : 1; + } + private static int CalculateStaticOffset(BaseCodeItem codeItem) { var codeItemElement = codeItem as BaseCodeItemElement; @@ -176,7 +176,7 @@ private static string NormalizeName(BaseCodeItem codeItem) { // Try to find where the interface ends and the method starts int dot = name.LastIndexOf('.') + 1; - if ((dot > 0) && (dot < name.Length)) + if (0 < dot && dot < name.Length) { return name.Substring(dot); } From e99905a6a7266c2e2d8865643128973780135280 Mon Sep 17 00:00:00 2001 From: abde Date: Sat, 17 Sep 2016 21:02:23 +0100 Subject: [PATCH 09/31] Now adds root tag if it doesn't exist --- CodeMaid/UI/Converters/DocCommentToStringConverter.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CodeMaid/UI/Converters/DocCommentToStringConverter.cs b/CodeMaid/UI/Converters/DocCommentToStringConverter.cs index f1464aae..7f756327 100644 --- a/CodeMaid/UI/Converters/DocCommentToStringConverter.cs +++ b/CodeMaid/UI/Converters/DocCommentToStringConverter.cs @@ -31,6 +31,10 @@ public object Convert(object value, Type targetType, object parameter, System.Gl try { + //In VB .NET the returned XML hasn't a tag so we add it to avoid a crash with multiple documentation tags + if (!str.StartsWith("")) + str = "" + str + ""; + var xElement = XElement.Parse(str); var summaryTag = xElement.DescendantsAndSelf("summary").FirstOrDefault(); From d77db218a8ad58d23a771e4d8499799a3f1eb59b Mon Sep 17 00:00:00 2001 From: Steve Cadwallader Date: Sat, 17 Sep 2016 17:15:08 -0400 Subject: [PATCH 10/31] Minor tweaks for the obsessive. ;) --- CodeMaid/UI/Converters/DocCommentToStringConverter.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/CodeMaid/UI/Converters/DocCommentToStringConverter.cs b/CodeMaid/UI/Converters/DocCommentToStringConverter.cs index 7f756327..2e247140 100644 --- a/CodeMaid/UI/Converters/DocCommentToStringConverter.cs +++ b/CodeMaid/UI/Converters/DocCommentToStringConverter.cs @@ -31,9 +31,12 @@ public object Convert(object value, Type targetType, object parameter, System.Gl try { - //In VB .NET the returned XML hasn't a tag so we add it to avoid a crash with multiple documentation tags + // In VB .NET the returned XML doesn't have a tag so we add it to avoid a crash + // with multiple documentation tags. if (!str.StartsWith("")) + { str = "" + str + ""; + } var xElement = XElement.Parse(str); From e5c152336e08adddc02da648703a18dd55e8de12 Mon Sep 17 00:00:00 2001 From: Abdelilah El Aissaoui Date: Tue, 22 Nov 2016 20:18:57 +0100 Subject: [PATCH 11/31] #342: Fixed regions for VB.NET --- CodeMaid/Model/CodeModelHelper.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CodeMaid/Model/CodeModelHelper.cs b/CodeMaid/Model/CodeModelHelper.cs index 23224442..69d1b725 100644 --- a/CodeMaid/Model/CodeModelHelper.cs +++ b/CodeMaid/Model/CodeModelHelper.cs @@ -146,7 +146,7 @@ internal CodeItemRegion RetrieveCodeRegionUnderCursor(TextDocument textDocument) /// /// Gets the regular expression pattern for region matching. /// - private string RegionPattern => @"^[ \t]*#(region|endregion)"; + private string RegionPattern => @"^[ \t]*#([Rr]egion|endregion|End Region)"; #endregion Private Properties @@ -169,7 +169,7 @@ private static IEnumerable RetrieveCodeRegions(IEnumerable RetrieveCodeRegions(IEnumerable 0) { From 908e4d0f48039f63d69a6f693825de23338f1a21 Mon Sep 17 00:00:00 2001 From: Steve Cadwallader Date: Sat, 10 Dec 2016 04:19:21 -0500 Subject: [PATCH 12/31] One-way upgrade to VS2017. --- CodeMaid.sln | 4 +- CodeMaid/CodeMaid.csproj | 2 +- CodeMaid/Properties/Settings.Designer.cs | 2 +- CodeMaid/app.config | 1076 +++++++++++----------- 4 files changed, 517 insertions(+), 567 deletions(-) diff --git a/CodeMaid.sln b/CodeMaid.sln index 74e667c6..c0232b9a 100644 --- a/CodeMaid.sln +++ b/CodeMaid.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -VisualStudioVersion = 14.0.24720.0 +# Visual Studio 15 +VisualStudioVersion = 15.0.25928.0 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{69127706-88D9-4314-B801-4FB2E615B700}" ProjectSection(SolutionItems) = preProject diff --git a/CodeMaid/CodeMaid.csproj b/CodeMaid/CodeMaid.csproj index 2ea0f0df..d48f0d81 100644 --- a/CodeMaid/CodeMaid.csproj +++ b/CodeMaid/CodeMaid.csproj @@ -14,7 +14,7 @@ True ..\CodeMaid.snk v4.5 - 14.0 + 15.0 12.0 diff --git a/CodeMaid/Properties/Settings.Designer.cs b/CodeMaid/Properties/Settings.Designer.cs index 30f81edb..e74f89f1 100644 --- a/CodeMaid/Properties/Settings.Designer.cs +++ b/CodeMaid/Properties/Settings.Designer.cs @@ -12,7 +12,7 @@ namespace SteveCadwallader.CodeMaid.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.0.0.0")] public sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); diff --git a/CodeMaid/app.config b/CodeMaid/app.config index 40b2bb03..1be21658 100644 --- a/CodeMaid/app.config +++ b/CodeMaid/app.config @@ -1,564 +1,514 @@ - + - - -
- - - - - - False - - - True - - - True - - - \.Designer\.cs$||\.Designer\.vb$||\.resx$ - - - True - - - True - - - True - - - False - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - False - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - False - - - True - - - False - - - True - - - True - - - False - - - True - - - False - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - 0 - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - 1 - - - True - - - True - - - True - - - True - - - False - - - False - - - True - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - True - - - - - - True - - - True - - - True - - - 15 - - - 10 - - - 17 - - - 0 - - - False - - - True - - - True - - - True - - - True - - - True - - - False - - - True - - - 100 - - - False - - - False - - - False - - - False - - - False - - - True - - - False - - - 0 - - - True - - - False - - - Segoe UI - - - 0 - - - True - - - True - - - True - - - 0 - - - True - - - True - - - True - - - True - - - True - - - False - - - True - - - Classes||12||Classes - - - Constructors||2||Constructors - - - Delegates||4||Delegates - - - Destructors||3||Destructors - - - Enums||6||Enums - - - Events||5||Events - - - Fields||1||Fields - - - Indexers||9||Indexers - - - Interfaces||7||Interfaces - - - Methods||10||Methods - - - Properties||8||Properties - - - Structs||11||Structs - - - 0 - - - False - - - False - - - False - - - False - - - False - - - False - - - .cpp .h||.xaml .xaml.cs||.xml .xsd||.ascx .ascx.cs||.aspx .aspx.cs||.master .master.cs - - - - - - False - - - False - - - False - - - - - - - - - - - - - - - \ No newline at end of file + + +
+ + + + + + False + + + True + + + True + + + \.Designer\.cs$||\.Designer\.vb$||\.resx$ + + + True + + + True + + + True + + + False + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + False + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + False + + + True + + + False + + + True + + + True + + + False + + + True + + + False + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + 0 + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + 1 + + + True + + + True + + + True + + + True + + + False + + + False + + + True + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + True + + + + + + True + + + True + + + True + + + 15 + + + 10 + + + 17 + + + 0 + + + False + + + True + + + True + + + True + + + True + + + True + + + False + + + True + + + 100 + + + False + + + False + + + False + + + False + + + False + + + True + + + False + + + 0 + + + True + + + False + + + Segoe UI + + + 0 + + + True + + + True + + + True + + + 0 + + + True + + + True + + + True + + + True + + + True + + + False + + + True + + + Classes||12||Classes + + + Constructors||2||Constructors + + + Delegates||4||Delegates + + + Destructors||3||Destructors + + + Enums||6||Enums + + + Events||5||Events + + + Fields||1||Fields + + + Indexers||9||Indexers + + + Interfaces||7||Interfaces + + + Methods||10||Methods + + + Properties||8||Properties + + + Structs||11||Structs + + + 0 + + + False + + + False + + + False + + + False + + + False + + + False + + + .cpp .h||.xaml .xaml.cs||.xml .xsd||.ascx .ascx.cs||.aspx .aspx.cs||.master .master.cs + + + + + + False + + + False + + + False + + + + + + + + + + + + + + From 0d2c4d7c7a4dc21a6856c948e2c2fc4995a7ebc6 Mon Sep 17 00:00:00 2001 From: Steve Cadwallader Date: Sat, 10 Dec 2016 04:25:52 -0500 Subject: [PATCH 13/31] Update debug path. --- CodeMaid/CodeMaid.csproj.user | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CodeMaid/CodeMaid.csproj.user b/CodeMaid/CodeMaid.csproj.user index b82d1dcd..f8b1055c 100644 --- a/CodeMaid/CodeMaid.csproj.user +++ b/CodeMaid/CodeMaid.csproj.user @@ -2,7 +2,7 @@ Program - C:\Program Files %28x86%29\Microsoft Visual Studio 14.0\Common7\IDE\devenv.exe + C:\Program Files %28x86%29\Microsoft Visual Studio\2017\Community\Common7\IDE\devenv.exe /rootsuffix Exp From afdab98fa4998670e773807871598b275b226a3a Mon Sep 17 00:00:00 2001 From: Steve Cadwallader Date: Sat, 10 Dec 2016 04:26:30 -0500 Subject: [PATCH 14/31] Add an initial prerequisite on the core editor. --- CodeMaid/CodeMaid.csproj | 2 +- CodeMaid/source.extension.vsixmanifest | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CodeMaid/CodeMaid.csproj b/CodeMaid/CodeMaid.csproj index d48f0d81..3bad5b4d 100644 --- a/CodeMaid/CodeMaid.csproj +++ b/CodeMaid/CodeMaid.csproj @@ -20,6 +20,7 @@ + false publish\ true Disk @@ -32,7 +33,6 @@ true 0 1.0.0.%2a - false false true diff --git a/CodeMaid/source.extension.vsixmanifest b/CodeMaid/source.extension.vsixmanifest index 254d58d2..a9394822 100644 --- a/CodeMaid/source.extension.vsixmanifest +++ b/CodeMaid/source.extension.vsixmanifest @@ -24,4 +24,7 @@ + + + \ No newline at end of file From eb294fc741efe539d45abe41c186869560dd02f6 Mon Sep 17 00:00:00 2001 From: Steve Cadwallader Date: Sat, 10 Dec 2016 05:10:13 -0500 Subject: [PATCH 15/31] Merge remove and sort using statements into a single option and command execution following VS2017 pattern change. --- .../Data/RemoveAndSortUsingStatements.cs | 14 + .../RemoveAndSortUsingStatements_Cleaned.cs | 11 + .../Data/RemoveUnusedUsingStatements.cs | 9 - .../RemoveUnusedUsingStatements_Cleaned.cs | 3 - .../VisualStudio/Data/SortUsingStatements.cs | 9 - .../Data/SortUsingStatements_Cleaned.cs | 9 - ...rtAfterRemoveUnusedUsingStatementsTests.cs | 6 +- ...s => RemoveAndSortUsingStatementsTests.cs} | 30 +- .../VisualStudio/SortUsingStatementsTests.cs | 81 -- .../CodeMaid.IntegrationTests.csproj | 13 +- CodeMaid/Logic/Cleaning/CodeCleanupManager.cs | 3 +- .../Cleaning/UsingStatementCleanupLogic.cs | 32 +- CodeMaid/Properties/Settings.Designer.cs | 36 +- CodeMaid/Properties/Settings.settings | 10 +- .../CleaningVisualStudioDataTemplate.xaml | 13 +- .../Cleaning/CleaningVisualStudioViewModel.cs | 35 +- CodeMaid/app.config | 1066 +++++++++-------- 17 files changed, 636 insertions(+), 744 deletions(-) create mode 100644 CodeMaid.IntegrationTests/Cleaning/VisualStudio/Data/RemoveAndSortUsingStatements.cs create mode 100644 CodeMaid.IntegrationTests/Cleaning/VisualStudio/Data/RemoveAndSortUsingStatements_Cleaned.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/VisualStudio/Data/RemoveUnusedUsingStatements.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/VisualStudio/Data/RemoveUnusedUsingStatements_Cleaned.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/VisualStudio/Data/SortUsingStatements.cs delete mode 100644 CodeMaid.IntegrationTests/Cleaning/VisualStudio/Data/SortUsingStatements_Cleaned.cs rename CodeMaid.IntegrationTests/Cleaning/VisualStudio/{RemoveUnusedUsingStatementsTests.cs => RemoveAndSortUsingStatementsTests.cs} (58%) delete mode 100644 CodeMaid.IntegrationTests/Cleaning/VisualStudio/SortUsingStatementsTests.cs diff --git a/CodeMaid.IntegrationTests/Cleaning/VisualStudio/Data/RemoveAndSortUsingStatements.cs b/CodeMaid.IntegrationTests/Cleaning/VisualStudio/Data/RemoveAndSortUsingStatements.cs new file mode 100644 index 00000000..d85b0c6e --- /dev/null +++ b/CodeMaid.IntegrationTests/Cleaning/VisualStudio/Data/RemoveAndSortUsingStatements.cs @@ -0,0 +1,14 @@ +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System; + +namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.VisualStudio.Data +{ + public class Class + { + public String String { get; set; } + public StringBuilder StringBuilder { get; set; } + } +} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/VisualStudio/Data/RemoveAndSortUsingStatements_Cleaned.cs b/CodeMaid.IntegrationTests/Cleaning/VisualStudio/Data/RemoveAndSortUsingStatements_Cleaned.cs new file mode 100644 index 00000000..ab2b8247 --- /dev/null +++ b/CodeMaid.IntegrationTests/Cleaning/VisualStudio/Data/RemoveAndSortUsingStatements_Cleaned.cs @@ -0,0 +1,11 @@ +using System; +using System.Text; + +namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.VisualStudio.Data +{ + public class Class + { + public String String { get; set; } + public StringBuilder StringBuilder { get; set; } + } +} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/VisualStudio/Data/RemoveUnusedUsingStatements.cs b/CodeMaid.IntegrationTests/Cleaning/VisualStudio/Data/RemoveUnusedUsingStatements.cs deleted file mode 100644 index 58dfb59c..00000000 --- a/CodeMaid.IntegrationTests/Cleaning/VisualStudio/Data/RemoveUnusedUsingStatements.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.VisualStudio.Data -{ -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/VisualStudio/Data/RemoveUnusedUsingStatements_Cleaned.cs b/CodeMaid.IntegrationTests/Cleaning/VisualStudio/Data/RemoveUnusedUsingStatements_Cleaned.cs deleted file mode 100644 index 424e7cba..00000000 --- a/CodeMaid.IntegrationTests/Cleaning/VisualStudio/Data/RemoveUnusedUsingStatements_Cleaned.cs +++ /dev/null @@ -1,3 +0,0 @@ -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.VisualStudio.Data -{ -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/VisualStudio/Data/SortUsingStatements.cs b/CodeMaid.IntegrationTests/Cleaning/VisualStudio/Data/SortUsingStatements.cs deleted file mode 100644 index f8a93d28..00000000 --- a/CodeMaid.IntegrationTests/Cleaning/VisualStudio/Data/SortUsingStatements.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System.Threading.Tasks; -using System; -using System.Collections.Generic; -using System.Text; -using System.Linq; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.VisualStudio.Data -{ -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/VisualStudio/Data/SortUsingStatements_Cleaned.cs b/CodeMaid.IntegrationTests/Cleaning/VisualStudio/Data/SortUsingStatements_Cleaned.cs deleted file mode 100644 index 58dfb59c..00000000 --- a/CodeMaid.IntegrationTests/Cleaning/VisualStudio/Data/SortUsingStatements_Cleaned.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.VisualStudio.Data -{ -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/Cleaning/VisualStudio/ReinsertAfterRemoveUnusedUsingStatementsTests.cs b/CodeMaid.IntegrationTests/Cleaning/VisualStudio/ReinsertAfterRemoveUnusedUsingStatementsTests.cs index ab364c8f..eedbe2b1 100644 --- a/CodeMaid.IntegrationTests/Cleaning/VisualStudio/ReinsertAfterRemoveUnusedUsingStatementsTests.cs +++ b/CodeMaid.IntegrationTests/Cleaning/VisualStudio/ReinsertAfterRemoveUnusedUsingStatementsTests.cs @@ -45,7 +45,7 @@ public void TestCleanup() [HostType("VS IDE")] public void CleaningVisualStudioReinsertAfterRemoveUnusedUsingStatements_RunsAsExpected() { - Settings.Default.Cleaning_RunVisualStudioRemoveUnusedUsingStatements = true; + Settings.Default.Cleaning_RunVisualStudioRemoveAndSortUsingStatements = true; Settings.Default.Cleaning_UsingStatementsToReinsertWhenRemovedExpression = "using System;||using System.Linq;"; TestOperations.ExecuteCommandAndVerifyResults(RunRemoveUnusedUsingStatements, _projectItem, @"Data\ReinsertAfterRemoveUnusedUsingStatements_Cleaned.cs"); @@ -55,7 +55,7 @@ public void CleaningVisualStudioReinsertAfterRemoveUnusedUsingStatements_RunsAsE [HostType("VS IDE")] public void CleaningVisualStudioReinsertAfterRemoveUnusedUsingStatements_DoesNothingWhenSettingIsDisabled() { - Settings.Default.Cleaning_RunVisualStudioRemoveUnusedUsingStatements = false; + Settings.Default.Cleaning_RunVisualStudioRemoveAndSortUsingStatements = false; Settings.Default.Cleaning_UsingStatementsToReinsertWhenRemovedExpression = "using System;||using System.Linq;"; TestOperations.ExecuteCommandAndVerifyNoChanges(RunRemoveUnusedUsingStatements, _projectItem); @@ -67,7 +67,7 @@ public void CleaningVisualStudioReinsertAfterRemoveUnusedUsingStatements_DoesNot private static void RunRemoveUnusedUsingStatements(Document document) { - _usingStatementCleanupLogic.RemoveUnusedUsingStatements(document.GetTextDocument()); + _usingStatementCleanupLogic.RemoveAndSortUsingStatements(document.GetTextDocument()); } #endregion Helpers diff --git a/CodeMaid.IntegrationTests/Cleaning/VisualStudio/RemoveUnusedUsingStatementsTests.cs b/CodeMaid.IntegrationTests/Cleaning/VisualStudio/RemoveAndSortUsingStatementsTests.cs similarity index 58% rename from CodeMaid.IntegrationTests/Cleaning/VisualStudio/RemoveUnusedUsingStatementsTests.cs rename to CodeMaid.IntegrationTests/Cleaning/VisualStudio/RemoveAndSortUsingStatementsTests.cs index ec99c509..bb49da41 100644 --- a/CodeMaid.IntegrationTests/Cleaning/VisualStudio/RemoveUnusedUsingStatementsTests.cs +++ b/CodeMaid.IntegrationTests/Cleaning/VisualStudio/RemoveAndSortUsingStatementsTests.cs @@ -8,9 +8,9 @@ namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.VisualStudio { [TestClass] - [DeploymentItem(@"Cleaning\VisualStudio\Data\RemoveUnusedUsingStatements.cs", "Data")] - [DeploymentItem(@"Cleaning\VisualStudio\Data\RemoveUnusedUsingStatements_Cleaned.cs", "Data")] - public class RemoveUnusedUsingStatementsTests + [DeploymentItem(@"Cleaning\VisualStudio\Data\RemoveAndSortUsingStatements.cs", "Data")] + [DeploymentItem(@"Cleaning\VisualStudio\Data\RemoveAndSortUsingStatements_Cleaned.cs", "Data")] + public class RemoveAndSortUsingStatementsTests { #region Setup @@ -28,7 +28,7 @@ public static void ClassInitialize(TestContext testContext) public void TestInitialize() { TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\RemoveUnusedUsingStatements.cs"); + _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\RemoveAndSortUsingStatements.cs"); } [TestCleanup] @@ -43,38 +43,38 @@ public void TestCleanup() [TestMethod] [HostType("VS IDE")] - public void CleaningVisualStudioRemoveUnusedUsingStatements_RunsAsExpected() + public void CleaningVisualStudioRemoveAndSortUsingStatements_RunsAsExpected() { - Settings.Default.Cleaning_RunVisualStudioRemoveUnusedUsingStatements = true; + Settings.Default.Cleaning_RunVisualStudioRemoveAndSortUsingStatements = true; - TestOperations.ExecuteCommandAndVerifyResults(RunRemoveUnusedUsingStatements, _projectItem, @"Data\RemoveUnusedUsingStatements_Cleaned.cs"); + TestOperations.ExecuteCommandAndVerifyResults(RunRemoveAndSortUsingStatements, _projectItem, @"Data\RemoveAndSortUsingStatements_Cleaned.cs"); } [TestMethod] [HostType("VS IDE")] - public void CleaningVisualStudioRemoveUnusedUsingStatements_DoesNothingOnSecondPass() + public void CleaningVisualStudioRemoveAndSortUsingStatements_DoesNothingOnSecondPass() { - Settings.Default.Cleaning_RunVisualStudioRemoveUnusedUsingStatements = true; + Settings.Default.Cleaning_RunVisualStudioRemoveAndSortUsingStatements = true; - TestOperations.ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass(RunRemoveUnusedUsingStatements, _projectItem); + TestOperations.ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass(RunRemoveAndSortUsingStatements, _projectItem); } [TestMethod] [HostType("VS IDE")] - public void CleaningVisualStudioRemoveUnusedUsingStatements_DoesNothingWhenSettingIsDisabled() + public void CleaningVisualStudioRemoveAndSortUsingStatements_DoesNothingWhenSettingIsDisabled() { - Settings.Default.Cleaning_RunVisualStudioRemoveUnusedUsingStatements = false; + Settings.Default.Cleaning_RunVisualStudioRemoveAndSortUsingStatements = false; - TestOperations.ExecuteCommandAndVerifyNoChanges(RunRemoveUnusedUsingStatements, _projectItem); + TestOperations.ExecuteCommandAndVerifyNoChanges(RunRemoveAndSortUsingStatements, _projectItem); } #endregion Tests #region Helpers - private static void RunRemoveUnusedUsingStatements(Document document) + private static void RunRemoveAndSortUsingStatements(Document document) { - _usingStatementCleanupLogic.RemoveUnusedUsingStatements(document.GetTextDocument()); + _usingStatementCleanupLogic.RemoveAndSortUsingStatements(document.GetTextDocument()); } #endregion Helpers diff --git a/CodeMaid.IntegrationTests/Cleaning/VisualStudio/SortUsingStatementsTests.cs b/CodeMaid.IntegrationTests/Cleaning/VisualStudio/SortUsingStatementsTests.cs deleted file mode 100644 index 95a26724..00000000 --- a/CodeMaid.IntegrationTests/Cleaning/VisualStudio/SortUsingStatementsTests.cs +++ /dev/null @@ -1,81 +0,0 @@ -using EnvDTE; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using SteveCadwallader.CodeMaid.IntegrationTests.Helpers; -using SteveCadwallader.CodeMaid.Logic.Cleaning; -using SteveCadwallader.CodeMaid.Properties; - -namespace SteveCadwallader.CodeMaid.IntegrationTests.Cleaning.VisualStudio -{ - [TestClass] - [DeploymentItem(@"Cleaning\VisualStudio\Data\SortUsingStatements.cs", "Data")] - [DeploymentItem(@"Cleaning\VisualStudio\Data\SortUsingStatements_Cleaned.cs", "Data")] - public class SortUsingStatementsTests - { - #region Setup - - private static UsingStatementCleanupLogic _usingStatementCleanupLogic; - private ProjectItem _projectItem; - - [ClassInitialize] - public static void ClassInitialize(TestContext testContext) - { - _usingStatementCleanupLogic = UsingStatementCleanupLogic.GetInstance(TestEnvironment.Package); - Assert.IsNotNull(_usingStatementCleanupLogic); - } - - [TestInitialize] - public void TestInitialize() - { - TestEnvironment.CommonTestInitialize(); - _projectItem = TestEnvironment.LoadFileIntoProject(@"Data\SortUsingStatements.cs"); - } - - [TestCleanup] - public void TestCleanup() - { - TestEnvironment.RemoveFromProject(_projectItem); - } - - #endregion Setup - - #region Tests - - [TestMethod] - [HostType("VS IDE")] - public void CleaningVisualStudioSortUsingStatements_RunsAsExpected() - { - Settings.Default.Cleaning_RunVisualStudioSortUsingStatements = true; - - TestOperations.ExecuteCommandAndVerifyResults(RunSortUsingStatements, _projectItem, @"Data\SortUsingStatements_Cleaned.cs"); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningVisualStudioSortUsingStatements_DoesNothingOnSecondPass() - { - Settings.Default.Cleaning_RunVisualStudioSortUsingStatements = true; - - TestOperations.ExecuteCommandTwiceAndVerifyNoChangesOnSecondPass(RunSortUsingStatements, _projectItem); - } - - [TestMethod] - [HostType("VS IDE")] - public void CleaningVisualStudioSortUsingStatements_DoesNothingWhenSettingIsDisabled() - { - Settings.Default.Cleaning_RunVisualStudioSortUsingStatements = false; - - TestOperations.ExecuteCommandAndVerifyNoChanges(RunSortUsingStatements, _projectItem); - } - - #endregion Tests - - #region Helpers - - private static void RunSortUsingStatements(Document document) - { - _usingStatementCleanupLogic.SortUsingStatements(); - } - - #endregion Helpers - } -} \ No newline at end of file diff --git a/CodeMaid.IntegrationTests/CodeMaid.IntegrationTests.csproj b/CodeMaid.IntegrationTests/CodeMaid.IntegrationTests.csproj index b0edf899..43f24d47 100644 --- a/CodeMaid.IntegrationTests/CodeMaid.IntegrationTests.csproj +++ b/CodeMaid.IntegrationTests/CodeMaid.IntegrationTests.csproj @@ -243,16 +243,10 @@ - + PreserveNewest - - PreserveNewest - - - PreserveNewest - - + PreserveNewest @@ -284,8 +278,7 @@ - - + diff --git a/CodeMaid/Logic/Cleaning/CodeCleanupManager.cs b/CodeMaid/Logic/Cleaning/CodeCleanupManager.cs index 44232c35..79d0fe6a 100644 --- a/CodeMaid/Logic/Cleaning/CodeCleanupManager.cs +++ b/CodeMaid/Logic/Cleaning/CodeCleanupManager.cs @@ -231,8 +231,7 @@ private void RunCodeCleanupCSharp(Document document) RunExternalFormatting(textDocument); if (!document.IsExternal()) { - _usingStatementCleanupLogic.RemoveUnusedUsingStatements(textDocument); - _usingStatementCleanupLogic.SortUsingStatements(); + _usingStatementCleanupLogic.RemoveAndSortUsingStatements(textDocument); } // Interpret the document into a collection of elements. diff --git a/CodeMaid/Logic/Cleaning/UsingStatementCleanupLogic.cs b/CodeMaid/Logic/Cleaning/UsingStatementCleanupLogic.cs index 2dfee9fa..7f51880f 100644 --- a/CodeMaid/Logic/Cleaning/UsingStatementCleanupLogic.cs +++ b/CodeMaid/Logic/Cleaning/UsingStatementCleanupLogic.cs @@ -56,13 +56,16 @@ private UsingStatementCleanupLogic(CodeMaidPackage package) #region Methods /// - /// Run the visual studio built-in remove unused using statements command. + /// Run the visual studio built-in remove and sort using statements command. /// + /// + /// Before VS2017 these were two separate commands. Starting in VS2017 they were merged into one. + /// /// The text document to update. - public void RemoveUnusedUsingStatements(TextDocument textDocument) + public void RemoveAndSortUsingStatements(TextDocument textDocument) { - if (!Settings.Default.Cleaning_RunVisualStudioRemoveUnusedUsingStatements) return; - if (_package.IsAutoSaveContext && Settings.Default.Cleaning_SkipRemoveUnusedUsingStatementsDuringAutoCleanupOnSave) return; + if (!Settings.Default.Cleaning_RunVisualStudioRemoveAndSortUsingStatements) return; + if (_package.IsAutoSaveContext && Settings.Default.Cleaning_SkipRemoveAndSortUsingStatementsDuringAutoCleanupOnSave) return; // Capture all existing using statements that should be re-inserted if removed. const string patternFormat = @"^[ \t]*{0}[ \t]*\r?\n"; @@ -78,7 +81,15 @@ from editPoint in TextDocumentHelper.FindMatches(textDocument, string.Format(pat point.editPoint.CharRight(); } - _package.IDE.ExecuteCommand("Edit.RemoveUnusedUsings", string.Empty); + if (_package.IDEVersion >= 15) + { + _package.IDE.ExecuteCommand("Edit.RemoveAndSort", string.Empty); + } + else + { + _package.IDE.ExecuteCommand("Edit.RemoveUnusedUsings", string.Empty); + _package.IDE.ExecuteCommand("Edit.SortUsings", string.Empty); + } // Check each using statement point and re-insert it if removed. foreach (var point in points) @@ -93,17 +104,6 @@ from editPoint in TextDocumentHelper.FindMatches(textDocument, string.Format(pat } } - /// - /// Run the visual studio built-in sort using statements command. - /// - public void SortUsingStatements() - { - if (!Settings.Default.Cleaning_RunVisualStudioSortUsingStatements) return; - if (_package.IsAutoSaveContext && Settings.Default.Cleaning_SkipSortUsingStatementsDuringAutoCleanupOnSave) return; - - _package.IDE.ExecuteCommand("Edit.SortUsings", string.Empty); - } - #endregion Methods } } \ No newline at end of file diff --git a/CodeMaid/Properties/Settings.Designer.cs b/CodeMaid/Properties/Settings.Designer.cs index e74f89f1..d78828b2 100644 --- a/CodeMaid/Properties/Settings.Designer.cs +++ b/CodeMaid/Properties/Settings.Designer.cs @@ -950,48 +950,24 @@ public bool Cleaning_RunVisualStudioFormatDocumentCommand { [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("True")] - public bool Cleaning_RunVisualStudioRemoveUnusedUsingStatements { + public bool Cleaning_RunVisualStudioRemoveAndSortUsingStatements { get { - return ((bool)(this["Cleaning_RunVisualStudioRemoveUnusedUsingStatements"])); + return ((bool)(this["Cleaning_RunVisualStudioRemoveAndSortUsingStatements"])); } set { - this["Cleaning_RunVisualStudioRemoveUnusedUsingStatements"] = value; + this["Cleaning_RunVisualStudioRemoveAndSortUsingStatements"] = value; } } [global::System.Configuration.UserScopedSettingAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("True")] - public bool Cleaning_RunVisualStudioSortUsingStatements { + public bool Cleaning_SkipRemoveAndSortUsingStatementsDuringAutoCleanupOnSave { get { - return ((bool)(this["Cleaning_RunVisualStudioSortUsingStatements"])); + return ((bool)(this["Cleaning_SkipRemoveAndSortUsingStatementsDuringAutoCleanupOnSave"])); } set { - this["Cleaning_RunVisualStudioSortUsingStatements"] = value; - } - } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("True")] - public bool Cleaning_SkipRemoveUnusedUsingStatementsDuringAutoCleanupOnSave { - get { - return ((bool)(this["Cleaning_SkipRemoveUnusedUsingStatementsDuringAutoCleanupOnSave"])); - } - set { - this["Cleaning_SkipRemoveUnusedUsingStatementsDuringAutoCleanupOnSave"] = value; - } - } - - [global::System.Configuration.UserScopedSettingAttribute()] - [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] - [global::System.Configuration.DefaultSettingValueAttribute("False")] - public bool Cleaning_SkipSortUsingStatementsDuringAutoCleanupOnSave { - get { - return ((bool)(this["Cleaning_SkipSortUsingStatementsDuringAutoCleanupOnSave"])); - } - set { - this["Cleaning_SkipSortUsingStatementsDuringAutoCleanupOnSave"] = value; + this["Cleaning_SkipRemoveAndSortUsingStatementsDuringAutoCleanupOnSave"] = value; } } diff --git a/CodeMaid/Properties/Settings.settings b/CodeMaid/Properties/Settings.settings index 6f2058dc..1f348587 100644 --- a/CodeMaid/Properties/Settings.settings +++ b/CodeMaid/Properties/Settings.settings @@ -233,18 +233,12 @@ True - + True - + True - - True - - - False - False diff --git a/CodeMaid/UI/Dialogs/Options/Cleaning/CleaningVisualStudioDataTemplate.xaml b/CodeMaid/UI/Dialogs/Options/Cleaning/CleaningVisualStudioDataTemplate.xaml index fc108496..2cdcc53c 100644 --- a/CodeMaid/UI/Dialogs/Options/Cleaning/CleaningVisualStudioDataTemplate.xaml +++ b/CodeMaid/UI/Dialogs/Options/Cleaning/CleaningVisualStudioDataTemplate.xaml @@ -6,11 +6,11 @@ - + + IsChecked="{Binding SkipRemoveAndSortUsingStatementsDuringAutoCleanupOnSave}" + IsEnabled="{Binding RunVisualStudioRemoveAndSortUsingStatements}" Margin="35,5,5,5" /> @@ -18,11 +18,6 @@ Text="{Binding UsingStatementsToReinsertWhenRemovedExpression, Converter={x:Static cnv:StringReplaceConverter.DoublePipeToNewLine}, UpdateSourceTrigger=PropertyChanged}" /> - - - \ No newline at end of file diff --git a/CodeMaid/UI/Dialogs/Options/Cleaning/CleaningVisualStudioViewModel.cs b/CodeMaid/UI/Dialogs/Options/Cleaning/CleaningVisualStudioViewModel.cs index 9ebfc0a2..b0a40346 100644 --- a/CodeMaid/UI/Dialogs/Options/Cleaning/CleaningVisualStudioViewModel.cs +++ b/CodeMaid/UI/Dialogs/Options/Cleaning/CleaningVisualStudioViewModel.cs @@ -20,10 +20,8 @@ public CleaningVisualStudioViewModel(CodeMaidPackage package, Settings activeSet Mappings = new SettingsToOptionsList(ActiveSettings, this) { new SettingToOptionMapping(x => ActiveSettings.Cleaning_RunVisualStudioFormatDocumentCommand, x => RunVisualStudioFormatDocument), - new SettingToOptionMapping(x => ActiveSettings.Cleaning_RunVisualStudioRemoveUnusedUsingStatements, x => RunVisualStudioRemoveUnusedUsingStatements), - new SettingToOptionMapping(x => ActiveSettings.Cleaning_RunVisualStudioSortUsingStatements, x => RunVisualStudioSortUsingStatements), - new SettingToOptionMapping(x => ActiveSettings.Cleaning_SkipRemoveUnusedUsingStatementsDuringAutoCleanupOnSave, x => SkipRemoveUnusedUsingStatementsDuringAutoCleanupOnSave), - new SettingToOptionMapping(x => ActiveSettings.Cleaning_SkipSortUsingStatementsDuringAutoCleanupOnSave, x => SkipSortUsingStatementsDuringAutoCleanupOnSave), + new SettingToOptionMapping(x => ActiveSettings.Cleaning_RunVisualStudioRemoveAndSortUsingStatements, x => RunVisualStudioRemoveAndSortUsingStatements), + new SettingToOptionMapping(x => ActiveSettings.Cleaning_SkipRemoveAndSortUsingStatementsDuringAutoCleanupOnSave, x => SkipRemoveAndSortUsingStatementsDuringAutoCleanupOnSave), new SettingToOptionMapping(x => ActiveSettings.Cleaning_UsingStatementsToReinsertWhenRemovedExpression, x => UsingStatementsToReinsertWhenRemovedExpression) }; } @@ -51,38 +49,19 @@ public bool RunVisualStudioFormatDocument } /// - /// Gets or sets the flag indicating if unused using statements should be removed. + /// Gets or sets the flag indicating if using statements should be removed and sorted. /// - public bool RunVisualStudioRemoveUnusedUsingStatements + public bool RunVisualStudioRemoveAndSortUsingStatements { get { return GetPropertyValue(); } set { SetPropertyValue(value); } } /// - /// Gets or sets the flag indicating if using statements should be sorted. + /// Gets or sets the flag indicating if using statements should not be removed and sorted + /// during auto cleanup on save. /// - public bool RunVisualStudioSortUsingStatements - { - get { return GetPropertyValue(); } - set { SetPropertyValue(value); } - } - - /// - /// Gets or sets the flag indicating if unused using statements should not be removed during - /// auto cleanup on save. - /// - public bool SkipRemoveUnusedUsingStatementsDuringAutoCleanupOnSave - { - get { return GetPropertyValue(); } - set { SetPropertyValue(value); } - } - - /// - /// Gets or sets the flag indicating if using statements should not be sorted during auto - /// cleanup on save. - /// - public bool SkipSortUsingStatementsDuringAutoCleanupOnSave + public bool SkipRemoveAndSortUsingStatementsDuringAutoCleanupOnSave { get { return GetPropertyValue(); } set { SetPropertyValue(value); } diff --git a/CodeMaid/app.config b/CodeMaid/app.config index 1be21658..bfdbe3c2 100644 --- a/CodeMaid/app.config +++ b/CodeMaid/app.config @@ -1,514 +1,556 @@ - - -
- - - - - - False - - - True - - - True - - - \.Designer\.cs$||\.Designer\.vb$||\.resx$ - - - True - - - True - - - True - - - False - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - False - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - False - - - True - - - False - - - True - - - True - - - False - - - True - - - False - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - 0 - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - True - - - 1 - - - True - - - True - - - True - - - True - - - False - - - False - - - True - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - True - - - - - - True - - - True - - - True - - - 15 - - - 10 - - - 17 - - - 0 - - - False - - - True - - - True - - - True - - - True - - - True - - - False - - - True - - - 100 - - - False - - - False - - - False - - - False - - - False - - - True - - - False - - - 0 - - - True - - - False - - - Segoe UI - - - 0 - - - True - - - True - - - True - - - 0 - - - True - - - True - - - True - - - True - - - True - - - False - - - True - - - Classes||12||Classes - - - Constructors||2||Constructors - - - Delegates||4||Delegates - - - Destructors||3||Destructors - - - Enums||6||Enums - - - Events||5||Events - - - Fields||1||Fields - - - Indexers||9||Indexers - - - Interfaces||7||Interfaces - - - Methods||10||Methods - - - Properties||8||Properties - - - Structs||11||Structs - - - 0 - - - False - - - False - - - False - - - False - - - False - - - False - - - .cpp .h||.xaml .xaml.cs||.xml .xsd||.ascx .ascx.cs||.aspx .aspx.cs||.master .master.cs - - - - - - False - - - False - - - False - - - - - - - - - - - - - - + + +
+ + + + + + False + + + True + + + True + + + \.Designer\.cs$||\.Designer\.vb$||\.resx$ + + + True + + + True + + + True + + + False + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + False + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + False + + + True + + + False + + + True + + + True + + + False + + + True + + + False + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + 0 + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + True + + + 1 + + + True + + + True + + + True + + + False + + + True + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + True + + + + + + True + + + True + + + True + + + 15 + + + 10 + + + 17 + + + 0 + + + False + + + True + + + True + + + True + + + True + + + True + + + False + + + True + + + 100 + + + False + + + False + + + False + + + False + + + False + + + True + + + False + + + 0 + + + True + + + False + + + Segoe UI + + + 0 + + + True + + + True + + + True + + + 0 + + + True + + + True + + + True + + + True + + + True + + + False + + + True + + + Classes||12||Classes + + + Constructors||2||Constructors + + + Delegates||4||Delegates + + + Destructors||3||Destructors + + + Enums||6||Enums + + + Events||5||Events + + + Fields||1||Fields + + + Indexers||9||Indexers + + + Interfaces||7||Interfaces + + + Methods||10||Methods + + + Properties||8||Properties + + + Structs||11||Structs + + + 0 + + + False + + + False + + + False + + + False + + + False + + + False + + + .cpp .h||.xaml .xaml.cs||.xml .xsd||.ascx .ascx.cs||.aspx .aspx.cs||.master .master.cs + + + + + + False + + + False + + + False + + + + + + + + + + + + + + \ No newline at end of file From 8b1e6622bfdb83eef4672af2396914cdb03efefa Mon Sep 17 00:00:00 2001 From: Steve Cadwallader Date: Sat, 10 Dec 2016 05:17:20 -0500 Subject: [PATCH 16/31] Tweak the HiveName for integration test settings. --- IntegrationTests.testsettings | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IntegrationTests.testsettings b/IntegrationTests.testsettings index 0bc364cb..60794d3d 100644 --- a/IntegrationTests.testsettings +++ b/IntegrationTests.testsettings @@ -3,7 +3,7 @@ These are test settings for using the VS IDE host type. - + From c94dfcf50495af511d01b79934ba1e887ab2740a Mon Sep 17 00:00:00 2001 From: Steve Cadwallader Date: Sat, 10 Dec 2016 06:56:31 -0500 Subject: [PATCH 17/31] #298: RegionHelper to generate language specific region tags. --- CodeMaid/CodeMaid.csproj | 1 + CodeMaid/Helpers/RegionHelper.cs | 41 +++++++++++++++++++ .../SpadeContextInsertRegionCommand.cs | 5 ++- .../Logic/Reorganizing/GenerateRegionLogic.cs | 4 +- CodeMaid/Model/CodeModelHelper.cs | 6 +-- 5 files changed, 50 insertions(+), 7 deletions(-) create mode 100644 CodeMaid/Helpers/RegionHelper.cs diff --git a/CodeMaid/CodeMaid.csproj b/CodeMaid/CodeMaid.csproj index 3bad5b4d..bdbca564 100644 --- a/CodeMaid/CodeMaid.csproj +++ b/CodeMaid/CodeMaid.csproj @@ -194,6 +194,7 @@ + diff --git a/CodeMaid/Helpers/RegionHelper.cs b/CodeMaid/Helpers/RegionHelper.cs new file mode 100644 index 00000000..965b6589 --- /dev/null +++ b/CodeMaid/Helpers/RegionHelper.cs @@ -0,0 +1,41 @@ +using EnvDTE; +using System; +using System.Collections.Generic; +using System.Linq; + +namespace SteveCadwallader.CodeMaid.Helpers +{ + /// + /// A static helper class for working with regions. + /// + internal static class RegionHelper + { + #region Internal Methods + + internal static string GetRegionTagText(EditPoint editPoint) + { + switch (editPoint.Parent.GetCodeLanguage()) + { + case CodeLanguage.VisualBasic: + return "#Region"; + + default: + return "#region"; + } + } + + internal static string GetEndRegionTagText(EditPoint editPoint) + { + switch (editPoint.Parent.GetCodeLanguage()) + { + case CodeLanguage.VisualBasic: + return "#End Region"; + + default: + return "#endregion"; + } + } + + #endregion Internal Methods + } +} \ No newline at end of file diff --git a/CodeMaid/Integration/Commands/SpadeContextInsertRegionCommand.cs b/CodeMaid/Integration/Commands/SpadeContextInsertRegionCommand.cs index 3d265b89..efec8c11 100644 --- a/CodeMaid/Integration/Commands/SpadeContextInsertRegionCommand.cs +++ b/CodeMaid/Integration/Commands/SpadeContextInsertRegionCommand.cs @@ -47,8 +47,9 @@ protected override void OnBeforeQueryStatus() var spade = Package.Spade; if (spade?.Document != null) { - visible = spade.Document.GetCodeLanguage() == CodeLanguage.CSharp && - spade.SelectedItems.Count() >= 2; + visible = spade.SelectedItems.Count() >= 2 && + (spade.Document.GetCodeLanguage() == CodeLanguage.CSharp || + spade.Document.GetCodeLanguage() == CodeLanguage.VisualBasic); } Visible = visible; diff --git a/CodeMaid/Logic/Reorganizing/GenerateRegionLogic.cs b/CodeMaid/Logic/Reorganizing/GenerateRegionLogic.cs index ecfef840..3d0aa860 100644 --- a/CodeMaid/Logic/Reorganizing/GenerateRegionLogic.cs +++ b/CodeMaid/Logic/Reorganizing/GenerateRegionLogic.cs @@ -177,7 +177,7 @@ public EditPoint InsertRegionTag(CodeItemRegion region, EditPoint startPoint) cursor.Insert(Environment.NewLine); } - cursor.Insert($"#region {region.Name}{Environment.NewLine}"); + cursor.Insert($"{RegionHelper.GetRegionTagText(cursor)} {region.Name}{Environment.NewLine}"); startPoint.SmartFormat(cursor); @@ -209,7 +209,7 @@ public EditPoint InsertEndRegionTag(CodeItemRegion region, EditPoint endPoint) cursor.Insert(Environment.NewLine); } - cursor.Insert("#endregion"); + cursor.Insert(RegionHelper.GetEndRegionTagText(cursor)); if (Settings.Default.Cleaning_UpdateEndRegionDirectives) { diff --git a/CodeMaid/Model/CodeModelHelper.cs b/CodeMaid/Model/CodeModelHelper.cs index 69d1b725..43a1a2b6 100644 --- a/CodeMaid/Model/CodeModelHelper.cs +++ b/CodeMaid/Model/CodeModelHelper.cs @@ -167,9 +167,9 @@ private static IEnumerable RetrieveCodeRegions(IEnumerable RetrieveCodeRegions(IEnumerable 0) { From 510dd27f224e4f992afbc7f00042d764960e4ea4 Mon Sep 17 00:00:00 2001 From: Steve Cadwallader Date: Sat, 10 Dec 2016 07:25:01 -0500 Subject: [PATCH 18/31] #298: Skip updating endregions for VB. Initial support for quoted region names for VB. --- CodeMaid/Helpers/RegionHelper.cs | 38 +++++++++++++++---- .../Logic/Reorganizing/GenerateRegionLogic.cs | 5 ++- CodeMaid/Model/CodeModelHelper.cs | 2 +- 3 files changed, 34 insertions(+), 11 deletions(-) diff --git a/CodeMaid/Helpers/RegionHelper.cs b/CodeMaid/Helpers/RegionHelper.cs index 965b6589..5024874c 100644 --- a/CodeMaid/Helpers/RegionHelper.cs +++ b/CodeMaid/Helpers/RegionHelper.cs @@ -1,7 +1,5 @@ using EnvDTE; using System; -using System.Collections.Generic; -using System.Linq; namespace SteveCadwallader.CodeMaid.Helpers { @@ -12,27 +10,51 @@ internal static class RegionHelper { #region Internal Methods - internal static string GetRegionTagText(EditPoint editPoint) + internal static string GetRegionTagText(EditPoint editPoint, string name = null) { - switch (editPoint.Parent.GetCodeLanguage()) + var codeLanguage = editPoint.Parent.GetCodeLanguage(); + switch (codeLanguage) { + case CodeLanguage.CSharp: + return "#region " + + (name ?? string.Empty); + case CodeLanguage.VisualBasic: - return "#Region"; + return "#Region " + + (name != null ? $"\"{name}\"" : string.Empty); default: - return "#region"; + throw new NotImplementedException($"Regions are not supported for '{codeLanguage}'."); } } internal static string GetEndRegionTagText(EditPoint editPoint) { - switch (editPoint.Parent.GetCodeLanguage()) + var codeLanguage = editPoint.Parent.GetCodeLanguage(); + switch (codeLanguage) { + case CodeLanguage.CSharp: + return "#endregion"; + case CodeLanguage.VisualBasic: return "#End Region"; default: - return "#endregion"; + throw new NotImplementedException($"Regions are not supported for '{codeLanguage}'."); + } + } + + internal static bool LanguageSupportsUpdatingEndRegionDirectives(EditPoint editPoint) + { + var codeLanguage = editPoint.Parent.GetCodeLanguage(); + + switch (codeLanguage) + { + case CodeLanguage.CSharp: + return true; + + default: + return false; } } diff --git a/CodeMaid/Logic/Reorganizing/GenerateRegionLogic.cs b/CodeMaid/Logic/Reorganizing/GenerateRegionLogic.cs index 3d0aa860..ae4698e1 100644 --- a/CodeMaid/Logic/Reorganizing/GenerateRegionLogic.cs +++ b/CodeMaid/Logic/Reorganizing/GenerateRegionLogic.cs @@ -177,7 +177,7 @@ public EditPoint InsertRegionTag(CodeItemRegion region, EditPoint startPoint) cursor.Insert(Environment.NewLine); } - cursor.Insert($"{RegionHelper.GetRegionTagText(cursor)} {region.Name}{Environment.NewLine}"); + cursor.Insert($"{RegionHelper.GetRegionTagText(cursor, region.Name)}{Environment.NewLine}"); startPoint.SmartFormat(cursor); @@ -211,7 +211,8 @@ public EditPoint InsertEndRegionTag(CodeItemRegion region, EditPoint endPoint) cursor.Insert(RegionHelper.GetEndRegionTagText(cursor)); - if (Settings.Default.Cleaning_UpdateEndRegionDirectives) + if (Settings.Default.Cleaning_UpdateEndRegionDirectives && + RegionHelper.LanguageSupportsUpdatingEndRegionDirectives(cursor)) { cursor.Insert(" " + region.Name); } diff --git a/CodeMaid/Model/CodeModelHelper.cs b/CodeMaid/Model/CodeModelHelper.cs index 43a1a2b6..e99aae54 100644 --- a/CodeMaid/Model/CodeModelHelper.cs +++ b/CodeMaid/Model/CodeModelHelper.cs @@ -169,7 +169,7 @@ private static IEnumerable RetrieveCodeRegions(IEnumerable Date: Sat, 10 Dec 2016 07:45:43 -0500 Subject: [PATCH 19/31] #298: Handle double quote syntax in VB region names. --- CodeMaid/Helpers/CodeCommentHelper.cs | 2 +- CodeMaid/Helpers/EditPointExtensions.cs | 10 ++++++++ CodeMaid/Helpers/RegionHelper.cs | 25 +++++++++++++++++--- CodeMaid/Logic/Cleaning/RemoveRegionLogic.cs | 3 ++- CodeMaid/Model/CodeModelHelper.cs | 2 +- 5 files changed, 36 insertions(+), 6 deletions(-) diff --git a/CodeMaid/Helpers/CodeCommentHelper.cs b/CodeMaid/Helpers/CodeCommentHelper.cs index bb1887c4..d65e0018 100644 --- a/CodeMaid/Helpers/CodeCommentHelper.cs +++ b/CodeMaid/Helpers/CodeCommentHelper.cs @@ -163,7 +163,7 @@ internal static int GetTabSize(CodeMaidPackage package, TextDocument document) internal static bool IsCommentLine(EditPoint point) { - return LineMatchesRegex(point, GetCommentRegex(point.Parent.GetCodeLanguage())).Success; + return LineMatchesRegex(point, GetCommentRegex(point.GetCodeLanguage())).Success; } internal static Match LineMatchesRegex(EditPoint point, Regex regex) diff --git a/CodeMaid/Helpers/EditPointExtensions.cs b/CodeMaid/Helpers/EditPointExtensions.cs index 02cc67ba..98dd7196 100644 --- a/CodeMaid/Helpers/EditPointExtensions.cs +++ b/CodeMaid/Helpers/EditPointExtensions.cs @@ -7,6 +7,16 @@ namespace SteveCadwallader.CodeMaid.Helpers ///
internal static class EditPointExtensions { + /// + /// Gets the for this edit point. + /// + /// The edit point. + /// A . + internal static CodeLanguage GetCodeLanguage(this EditPoint editPoint) + { + return editPoint.Parent.GetCodeLanguage(); + } + /// /// Gets the text for the line where the edit point is located. /// diff --git a/CodeMaid/Helpers/RegionHelper.cs b/CodeMaid/Helpers/RegionHelper.cs index 5024874c..f987097b 100644 --- a/CodeMaid/Helpers/RegionHelper.cs +++ b/CodeMaid/Helpers/RegionHelper.cs @@ -10,9 +10,28 @@ internal static class RegionHelper { #region Internal Methods + internal static string GetRegionName(EditPoint editPoint, string regionText) + { + var codeLanguage = editPoint.GetCodeLanguage(); + switch (codeLanguage) + { + case CodeLanguage.CSharp: + return regionText.Substring(8).Trim(); + + case CodeLanguage.VisualBasic: + // Remove the leading/trailing double quote character. + var text = regionText.Substring(8).Trim(); + text = text.Substring(1, text.Length - 2); + return text; + + default: + throw new NotImplementedException($"Regions are not supported for '{codeLanguage}'."); + } + } + internal static string GetRegionTagText(EditPoint editPoint, string name = null) { - var codeLanguage = editPoint.Parent.GetCodeLanguage(); + var codeLanguage = editPoint.GetCodeLanguage(); switch (codeLanguage) { case CodeLanguage.CSharp: @@ -30,7 +49,7 @@ internal static string GetRegionTagText(EditPoint editPoint, string name = null) internal static string GetEndRegionTagText(EditPoint editPoint) { - var codeLanguage = editPoint.Parent.GetCodeLanguage(); + var codeLanguage = editPoint.GetCodeLanguage(); switch (codeLanguage) { case CodeLanguage.CSharp: @@ -46,7 +65,7 @@ internal static string GetEndRegionTagText(EditPoint editPoint) internal static bool LanguageSupportsUpdatingEndRegionDirectives(EditPoint editPoint) { - var codeLanguage = editPoint.Parent.GetCodeLanguage(); + var codeLanguage = editPoint.GetCodeLanguage(); switch (codeLanguage) { diff --git a/CodeMaid/Logic/Cleaning/RemoveRegionLogic.cs b/CodeMaid/Logic/Cleaning/RemoveRegionLogic.cs index 2bb92e42..5c764d83 100644 --- a/CodeMaid/Logic/Cleaning/RemoveRegionLogic.cs +++ b/CodeMaid/Logic/Cleaning/RemoveRegionLogic.cs @@ -62,7 +62,8 @@ internal bool CanRemoveRegions(Document document) { return _package.IDE.Debugger.CurrentMode == dbgDebugMode.dbgDesignMode && document != null && - document.GetCodeLanguage() == CodeLanguage.CSharp; + (document.GetCodeLanguage() == CodeLanguage.CSharp || + document.GetCodeLanguage() == CodeLanguage.VisualBasic); } /// diff --git a/CodeMaid/Model/CodeModelHelper.cs b/CodeMaid/Model/CodeModelHelper.cs index e99aae54..391cb320 100644 --- a/CodeMaid/Model/CodeModelHelper.cs +++ b/CodeMaid/Model/CodeModelHelper.cs @@ -172,7 +172,7 @@ private static IEnumerable RetrieveCodeRegions(IEnumerable Date: Sat, 10 Dec 2016 07:48:53 -0500 Subject: [PATCH 20/31] #298: Tweak for VB so highlight after region generation does not include the trailing double quote. --- .../Commands/SpadeContextInsertRegionCommand.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CodeMaid/Integration/Commands/SpadeContextInsertRegionCommand.cs b/CodeMaid/Integration/Commands/SpadeContextInsertRegionCommand.cs index efec8c11..8baaf5a2 100644 --- a/CodeMaid/Integration/Commands/SpadeContextInsertRegionCommand.cs +++ b/CodeMaid/Integration/Commands/SpadeContextInsertRegionCommand.cs @@ -81,6 +81,13 @@ protected override void OnExecute() // Highlight the line of text for renaming. var textDocument = spade.Document.GetTextDocument(); textDocument.Selection.EndOfLine(true); + + // Move back one character for VB to offset the double quote character. + if (textDocument.GetCodeLanguage() == CodeLanguage.VisualBasic) + { + textDocument.Selection.CharLeft(true); + } + textDocument.Selection.SwapAnchor(); }); From d44400e3f74c0d557550b925f3bb81312b82f626 Mon Sep 17 00:00:00 2001 From: Steve Cadwallader Date: Sun, 11 Dec 2016 06:57:58 -0500 Subject: [PATCH 21/31] Bump to VS2017 image in appveyor --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 4a33f2b4..9d3b71f1 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,5 +1,5 @@ version: 10.1.{build} -os: Visual Studio 2015 +image: Visual Studio 2017 RC install: - ps: (new-object Net.WebClient).DownloadString("https://raw.github.com/madskristensen/ExtensionScripts/master/AppVeyor/vsix.ps1") | iex From 37bcb69d672fb6f3d7d4b07200594ac5a0e881a8 Mon Sep 17 00:00:00 2001 From: Steve Cadwallader Date: Sun, 11 Dec 2016 07:18:23 -0500 Subject: [PATCH 22/31] Tweak README. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b0d3d315..626c5bed 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@
codemaid.net
For more details, please visit: http://www.codemaid.net
-

Currently supports VS2012, VS2013, VS2015 and VS "15" Preview.

+

Currently supports VS2012, VS2013, VS2015 and VS2017.

For Visual Studio 2010, the last supported version is v0.8.1.

For Visual Studio 2005/2008, the last supported version is v0.4.3.

Links

From 095beaa88e2b95d2669400ecf2c9da6074c15453 Mon Sep 17 00:00:00 2001 From: Steve Cadwallader Date: Sun, 11 Dec 2016 07:31:44 -0500 Subject: [PATCH 23/31] Experiment with specifying 'os' instead of 'image' --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 9d3b71f1..04ed8583 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,5 +1,5 @@ version: 10.1.{build} -image: Visual Studio 2017 RC +os: Visual Studio 2017 RC install: - ps: (new-object Net.WebClient).DownloadString("https://raw.github.com/madskristensen/ExtensionScripts/master/AppVeyor/vsix.ps1") | iex From 7a582552b14939814f387021b82b6e81d7ac85c4 Mon Sep 17 00:00:00 2001 From: Steve Cadwallader Date: Sun, 11 Dec 2016 07:34:51 -0500 Subject: [PATCH 24/31] Experiment with image: VS2015 --- appveyor.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/appveyor.yml b/appveyor.yml index 04ed8583..91a363ed 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,5 +1,5 @@ version: 10.1.{build} -os: Visual Studio 2017 RC +image: Visual Studio 2015 install: - ps: (new-object Net.WebClient).DownloadString("https://raw.github.com/madskristensen/ExtensionScripts/master/AppVeyor/vsix.ps1") | iex From 1d432ca3eb14ae1e88dc09c4bac88f216ea71288 Mon Sep 17 00:00:00 2001 From: Steve Cadwallader Date: Sun, 11 Dec 2016 07:38:24 -0500 Subject: [PATCH 25/31] Update CHANGELOG with v10.2 --- CHANGELOG.md | 14 ++++++++++++-- appveyor.yml | 2 +- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 866c3ae0..740506a6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,20 @@ # Changelog -## vNext (TBD) +## vNext (10.2) These changes have not been released to the official Visual Studio extension gallery, but (if checked) are available in preview within the [CI build](http://vsixgallery.com/extension/4c82e17d-927e-42d2-8460-b473ac7df316/). -- [ ] TBD +- [x] Features + - [x] [#284](https://github.com/codecadwallader/codemaid/issues/284) - Performance improvements to compiling regular expressions - thanks [flagbug](https://github.com/flagbug)! + - [x] [#298](https://github.com/codecadwallader/codemaid/issues/298) - First class support for VB regions (viewing, inserting and removing) + - [x] [#337](https://github.com/codecadwallader/codemaid/issues/337) - Reorganizing: Add option to put explicit interface implementations after other members - thanks [samcragg](https://github.com/samcragg)! + - [x] [#371](https://github.com/codecadwallader/codemaid/issues/371) - Support for VS2017 RC + +- [x] Fixes + - [x] [#290](https://github.com/codecadwallader/codemaid/issues/290) - Finding: When track active item is enabled an error can be displayed on invocation + - [x] [#315](https://github.com/codecadwallader/codemaid/issues/315) - Reorganizing: Explicit interface implementations may take multiple passes to get in stable order - thanks [samcragg](https://github.com/samcragg)! + - [x] [#326](https://github.com/codecadwallader/codemaid/issues/326) - Digging: VB comments were not visible + - [x] [#342](https://github.com/codecadwallader/codemaid/issues/342) - Digging: VB regions were not visible - thanks [aeab13](https://github.com/aeab13)! ## Previous Releases diff --git a/appveyor.yml b/appveyor.yml index 91a363ed..9d3b71f1 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,5 +1,5 @@ version: 10.1.{build} -image: Visual Studio 2015 +image: Visual Studio 2017 RC install: - ps: (new-object Net.WebClient).DownloadString("https://raw.github.com/madskristensen/ExtensionScripts/master/AppVeyor/vsix.ps1") | iex From c6bb1efe014e01c34221fde10f5e07799618b376 Mon Sep 17 00:00:00 2001 From: Steve Cadwallader Date: Sun, 11 Dec 2016 07:47:05 -0500 Subject: [PATCH 26/31] Disable two unit tests that won't work in VS2017 RC context. --- CodeMaid.UnitTests/SpadeTest.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CodeMaid.UnitTests/SpadeTest.cs b/CodeMaid.UnitTests/SpadeTest.cs index ab608399..02f52f6a 100644 --- a/CodeMaid.UnitTests/SpadeTest.cs +++ b/CodeMaid.UnitTests/SpadeTest.cs @@ -6,6 +6,8 @@ namespace SteveCadwallader.CodeMaid.UnitTests { [TestClass] + [Ignore] + //TODO: Disabled while experimenting with VS2017 RC. public class SpadeTest { [TestMethod] From 5e3a69c7be7905391eabf496cbad343c119a2a6d Mon Sep 17 00:00:00 2001 From: Steve Cadwallader Date: Sun, 11 Dec 2016 07:47:21 -0500 Subject: [PATCH 27/31] Update to v10.2 label. --- CodeMaid/Integration/Images/about.png | Bin 50124 -> 50480 bytes CodeMaid/Integration/Images/about.xcf | Bin 108891 -> 109088 bytes CodeMaid/source.extension.vsixmanifest | 2 +- appveyor.yml | 2 +- 4 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CodeMaid/Integration/Images/about.png b/CodeMaid/Integration/Images/about.png index 5d2f76073258a61007fcc0ad51946bc0e10a27c1..43f064655b9785d3df0361eac8c4cf1d18c41b42 100644 GIT binary patch literal 50480 zcmb5V1z1$=_cl6oca5}^bV*4H(nzOtNl7CxbazRslyr%7N#}rwh=_CyDbgTa-^2U< ze*f<~*LBWy&e4s^c9^~AdDdF@z3z4I7!5TAJZwsA2n2$sq$sNefuJ};AV`>)=-|vF zt5PiR7rLd2f-L0j{`ZHD(o}E;%T@7(2Lysca{q+{d7ljhCox_tsmft2BELzHBtbzrkQIX(uYwoP|kCMFB2-u0LQ^q4J3v2Dl>vczP}eAb$_Un}_DXDJoD zWAY$TWj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