Skip to content

Commit

Permalink
Merge branch 'master' into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
codecadwallader committed Jun 9, 2018
2 parents 7273b60 + 7c60433 commit 43361ef
Show file tree
Hide file tree
Showing 154 changed files with 9,044 additions and 2,012 deletions.
25 changes: 21 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,34 @@
# Changelog

## vNext (10.5)
## vNext (10.6)

These changes have not been released to the Visual Studio marketplace, but (if checked) are available in preview within the [CI build](http://vsixgallery.com/extension/4c82e17d-927e-42d2-8460-b473ac7df316/).

- [x] Features

- [x] Fixes
- [ ] Features
- [ ] Fixes

## Previous Releases

These are the changes to each version that has been released to the Visual Studio marketplace.

## 10.5

**2018-06-09**

- [x] Features
- [x] [#477](https://github.com/codecadwallader/codemaid/pull/477) - Digging: New radial progress bar - thanks [Jammer77](https://github.com/Jammer77)!
- [x] [#506](https://github.com/codecadwallader/codemaid/pull/506) - Enable localization for Chinese - thanks [maikebing](https://github.com/maikebing)!
- [x] [#519](https://github.com/codecadwallader/codemaid/pull/519) - Simplify the code by removing unnecessary guids - thanks [heku](https://github.com/heku)!
- [x] [#525](https://github.com/codecadwallader/codemaid/pull/525) - Make all features switchable - thanks [heku](https://github.com/heku)!
- [x] [#545](https://github.com/codecadwallader/codemaid/pull/545) - Ignore comment lines starting with certain prefixes - thanks [willemduncan](https://github.com/willemduncan)!

- [x] Fixes
- [x] [#479](https://github.com/codecadwallader/codemaid/pull/479) - Update XAML Styler integration mappings - thanks [grochocki](https://github.com/grochocki)!
- [x] [#496](https://github.com/codecadwallader/codemaid/pull/496) - Fix the .NET Framework minimum required version (which is v4.6)
- [x] [#541](https://github.com/codecadwallader/codemaid/pull/541) - Project file (.csproj) cleanup - thanks [heku](https://github.com/heku)!
- [x] [#546](https://github.com/codecadwallader/codemaid/pull/546) - Fix a setting that would leave a trailing white space when formatting comments - thanks [willemduncan](https://github.com/willemduncan)!
- [x] [#556](https://github.com/codecadwallader/codemaid/issues/556) - Partial fix reducing how long we will block waiting for a code model to be built.

## 10.4

**2017-03-26**
Expand Down
2 changes: 1 addition & 1 deletion CodeMaid.IntegrationTests/CodeMaid.IntegrationTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath>
<IsCodedUITest>False</IsCodedUITest>
<TestProjectType>UnitTest</TestProjectType>
<TargetFrameworkProfile />
<LangVersion>latest</LangVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand Down
4 changes: 2 additions & 2 deletions CodeMaid.IntegrationTests/DialogTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public void ShowAboutTest()
{
dialogBoxPurger.Start();

var aboutCommand = new CommandID(PackageGuids.GuidCodeMaidCommandAbout, PackageIds.CmdIDCodeMaidAbout);
var aboutCommand = new CommandID(PackageGuids.GuidCodeMaidMenuSet, PackageIds.CmdIDCodeMaidAbout);
TestUtils.ExecuteCommand(aboutCommand);
}
finally
Expand All @@ -43,7 +43,7 @@ public void ShowConfigurationTest()
{
dialogBoxPurger.Start();

var configurationCommand = new CommandID(PackageGuids.GuidCodeMaidCommandOptions, PackageIds.CmdIDCodeMaidOptions);
var configurationCommand = new CommandID(PackageGuids.GuidCodeMaidMenuSet, PackageIds.CmdIDCodeMaidOptions);
TestUtils.ExecuteCommand(configurationCommand);
}
finally
Expand Down
2 changes: 1 addition & 1 deletion CodeMaid.IntegrationTests/Sorting/SortAtBottomTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ private static void RunSort(Document document)
textDocument.Selection.EndOfDocument();
textDocument.Selection.LineUp(true, 4);

var sortCommand = new CommandID(PackageGuids.GuidCodeMaidCommandSortLines, PackageIds.CmdIDCodeMaidSortLines);
var sortCommand = new CommandID(PackageGuids.GuidCodeMaidMenuSet, PackageIds.CmdIDCodeMaidSortLines);
TestUtils.ExecuteCommand(sortCommand);
}

Expand Down
2 changes: 1 addition & 1 deletion CodeMaid.IntegrationTests/Sorting/SortAtTopTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ private static void RunSort(Document document)
textDocument.Selection.StartOfDocument();
textDocument.Selection.LineDown(true, 4);

var sortCommand = new CommandID(PackageGuids.GuidCodeMaidCommandSortLines, PackageIds.CmdIDCodeMaidSortLines);
var sortCommand = new CommandID(PackageGuids.GuidCodeMaidMenuSet, PackageIds.CmdIDCodeMaidSortLines);
TestUtils.ExecuteCommand(sortCommand);
}

Expand Down
2 changes: 1 addition & 1 deletion CodeMaid.IntegrationTests/Sorting/SortNoChangeTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ private static void RunSort(Document document)
var textDocument = TestUtils.GetTextDocument(document);
textDocument.Selection.SelectAll();

var sortCommand = new CommandID(PackageGuids.GuidCodeMaidCommandSortLines, PackageIds.CmdIDCodeMaidSortLines);
var sortCommand = new CommandID(PackageGuids.GuidCodeMaidMenuSet, PackageIds.CmdIDCodeMaidSortLines);
TestUtils.ExecuteCommand(sortCommand);
}

Expand Down
4 changes: 2 additions & 2 deletions CodeMaid.IntegrationTests/ToolWindowTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public void ShowBuildProgressTest()
{
UIThreadInvoker.Invoke(new Action(() =>
{
var buildProgressToolWindowCommand = new CommandID(PackageGuids.GuidCodeMaidCommandBuildProgressToolWindow, PackageIds.CmdIDCodeMaidBuildProgressToolWindow);
var buildProgressToolWindowCommand = new CommandID(PackageGuids.GuidCodeMaidMenuSet, PackageIds.CmdIDCodeMaidBuildProgressToolWindow);
TestUtils.ExecuteCommand(buildProgressToolWindowCommand);

Assert.IsTrue(TestUtils.CanFindToolwindow(PackageGuids.GuidCodeMaidToolWindowBuildProgress));
Expand All @@ -28,7 +28,7 @@ public void ShowSpadeTest()
{
UIThreadInvoker.Invoke(new Action(() =>
{
var spadeToolWindowCommand = new CommandID(PackageGuids.GuidCodeMaidCommandSpadeToolWindow, PackageIds.CmdIDCodeMaidSpadeToolWindow);
var spadeToolWindowCommand = new CommandID(PackageGuids.GuidCodeMaidMenuSet, PackageIds.CmdIDCodeMaidSpadeToolWindow);
TestUtils.ExecuteCommand(spadeToolWindowCommand);

Assert.IsTrue(TestUtils.CanFindToolwindow(PackageGuids.GuidCodeMaidToolWindowSpade));
Expand Down
4 changes: 3 additions & 1 deletion CodeMaid.UnitTests/CodeMaid.UnitTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath>
<IsCodedUITest>False</IsCodedUITest>
<TestProjectType>UnitTest</TestProjectType>
<TargetFrameworkProfile />
<LangVersion>latest</LangVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand Down Expand Up @@ -113,11 +113,13 @@
<Compile Include="Formatting\CommentFormatHelper.cs" />
<Compile Include="Formatting\HeaderFormattingTests.cs" />
<Compile Include="Formatting\FormatWithPrefixTests.cs" />
<Compile Include="Formatting\IgnorePrefixesTests.cs" />
<Compile Include="Formatting\SimpleFormattingTests.cs" />
<Compile Include="Formatting\XmlFormattingTests.cs" />
<Compile Include="Formatting\ListFormattingTests.cs" />
<Compile Include="Helpers\CodeItemTypeComparerTests.cs" />
<Compile Include="Helpers\CodeMaidPackageHelper.cs" />
<Compile Include="Helpers\SettingsMonitorTests.cs" />
<Compile Include="Helpers\UIShellServiceMock.cs" />
<Compile Include="Helpers\WindowFrameMock.cs" />
<Compile Include="CodeMaidPackageTest.cs" />
Expand Down
8 changes: 1 addition & 7 deletions CodeMaid.UnitTests/Formatting/CommentFormatHelper.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
using SteveCadwallader.CodeMaid.Helpers;
using SteveCadwallader.CodeMaid.Model.Comments;
using System;
using System.Collections.Generic;
using System.Xml.Linq;

namespace SteveCadwallader.CodeMaid.UnitTests.Formatting
{
Expand Down Expand Up @@ -38,11 +36,7 @@ public static string Format(string text)

public static string Format(string text, string prefix)
{
var xml = XElement.Parse($"<doc>{text}</doc>");
var line = new CommentLineXml(xml);
var regex = CodeCommentHelper.GetCommentRegex(CodeLanguage.CSharp, !string.IsNullOrEmpty(prefix));
var formatter = new CommentFormatter(line, prefix, 4, regex);
return formatter.ToString();
return CodeComment.FormatXml(text, prefix);
}
}
}
71 changes: 71 additions & 0 deletions CodeMaid.UnitTests/Formatting/IgnorePrefixesTests.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
using SteveCadwallader.CodeMaid.Properties;
using System;

namespace SteveCadwallader.CodeMaid.UnitTests.Formatting
{
/// <summary>
/// Test for the ignoring of comments lines starting with certain prefixes.
/// </summary>
[TestClass]
public class IgnorePrefixesTests
{
[TestInitialize]
public void TestInitialize()
{
Settings.Default.Reset();
}

[TestMethod]
[TestCategory("Formatting UnitTests")]
public void IgnorePrefixesTests_DoesNotWrapSingleLine()
{
Settings.Default.Formatting_CommentWrapColumn = 30;
CommentFormatHelper.AssertEqualAfterFormat(@"TODO: Lorem ipsum dolor sit amet, consectetur adipiscing elit.");
}

[TestMethod]
[TestCategory("Formatting UnitTests")]
public void IgnorePrefixesTests_DoesNotWrapLineInsideComment()
{
var input =
"Lorem ipsum dolor sit amet, consectetur adipiscing elit." + Environment.NewLine +
"TODO: Lorem ipsum dolor sit amet, consectetur adipiscing elit." + Environment.NewLine +
"Lorem ipsum dolor sit amet, consectetur adipiscing elit.";

// Expect all lines to be wrapped except for the one starting with "TODO".
var expected =
"Lorem ipsum dolor sit amet," + Environment.NewLine +
"consectetur adipiscing elit." + Environment.NewLine +
"TODO: Lorem ipsum dolor sit amet, consectetur adipiscing elit." + Environment.NewLine +
"Lorem ipsum dolor sit amet," + Environment.NewLine +
"consectetur adipiscing elit.";

Settings.Default.Formatting_CommentWrapColumn = 30;
CommentFormatHelper.AssertEqualAfterFormat(input, expected);
}

[TestMethod]
[TestCategory("Formatting UnitTests")]
public void IgnorePrefixesTests_DoesNotCombineSubsequentLines()
{
var input =
"Lorem ipsum dolor sit amet, consectetur adipiscing elit." + Environment.NewLine +
"TODO: Lorem ipsum dolor sit amet, consectetur adipiscing elit." + Environment.NewLine +
"TODO: Lorem ipsum dolor sit amet, consectetur adipiscing elit." + Environment.NewLine +
"Lorem ipsum dolor sit amet, consectetur adipiscing elit.";

// Expect every "ignored" line to stay on it's own.
var expected =
"Lorem ipsum dolor sit amet," + Environment.NewLine +
"consectetur adipiscing elit." + Environment.NewLine +
"TODO: Lorem ipsum dolor sit amet, consectetur adipiscing elit." + Environment.NewLine +
"TODO: Lorem ipsum dolor sit amet, consectetur adipiscing elit." + Environment.NewLine +
"Lorem ipsum dolor sit amet," + Environment.NewLine +
"consectetur adipiscing elit.";

Settings.Default.Formatting_CommentWrapColumn = 30;
CommentFormatHelper.AssertEqualAfterFormat(input, expected);
}
}
}
47 changes: 47 additions & 0 deletions CodeMaid.UnitTests/Formatting/XmlFormattingTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,53 @@ public void XmlFormattingTests_AddSpaceToTagContent()
CommentFormatHelper.AssertEqualAfterFormat(input, expected);
}

[TestMethod]
[TestCategory("Formatting UnitTests")]
public void XmlFormattingTests_AddSpaceToTagContentWithSelfClosingTag()
{
var input = "<summary><see/></summary>";
var expected = "<summary> <see/> </summary>";

Settings.Default.Formatting_CommentXmlSplitSummaryTagToMultipleLines = false;
Settings.Default.Formatting_CommentXmlSpaceTags = true;

CommentFormatHelper.AssertEqualAfterFormat(input, expected);
}

[TestMethod]
[TestCategory("Formatting UnitTests")]
public void XmlFormattingTests_AddSpaceToTagContentWithSelfClosingTagMultiline()
{
var input = "<summary><see/></summary>";
var expected =
"<summary>" + Environment.NewLine +
"<see/>" + Environment.NewLine +
"</summary>";

Settings.Default.Formatting_CommentXmlSplitSummaryTagToMultipleLines = true;
Settings.Default.Formatting_CommentXmlSpaceTags = true;

CommentFormatHelper.AssertEqualAfterFormat(input, expected);
}

[TestMethod]
[TestCategory("Formatting UnitTests")]
public void XmlFormattingTests_AddSpaceToTagContentShouldLeaveNoTrailingWhitespace()
{
var input = "<summary>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</summary>";
var expected =
"<summary>" + Environment.NewLine +
"Lorem ipsum dolor sit amet," + Environment.NewLine +
"consectetur adipiscing elit." + Environment.NewLine +
"</summary>";

Settings.Default.Formatting_CommentWrapColumn = 30;
Settings.Default.Formatting_CommentXmlSplitSummaryTagToMultipleLines = true;
Settings.Default.Formatting_CommentXmlSpaceTags = true;

CommentFormatHelper.AssertEqualAfterFormat(input, expected);
}

[TestMethod]
[TestCategory("Formatting UnitTests")]
public void XmlFormattingTests_AllRootLevelTagsOnNewLine()
Expand Down
2 changes: 1 addition & 1 deletion CodeMaid.UnitTests/Helpers/CodeItemTypeComparerTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,4 @@ private static CodeItemMethod CreateExplicitMethod(string interfaceName, string
return method;
}
}
}
}
Loading

0 comments on commit 43361ef

Please sign in to comment.