forked from jakubbielawa/LineEndingsUnifier
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- added new option - Remove Trailing Whitespace
- Loading branch information
1 parent
6df80db
commit 88698f2
Showing
5 changed files
with
69 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
|
||
namespace JakubBielawa.LineEndingsUnifier | ||
{ | ||
public static class TrailingWhitespaceRemover | ||
{ | ||
public static string RemoveTrailingWhitespace(string text) | ||
{ | ||
var stringBuilder = new StringBuilder(); | ||
|
||
var lines = text.Split(new string[] { "\r\n", "\r", "\n" }, StringSplitOptions.None); | ||
for (var i = 0; i < lines.Length - 1; i++) | ||
{ | ||
stringBuilder.AppendLine(lines[i].TrimEnd()); | ||
} | ||
stringBuilder.Append(lines[lines.Length - 1].TrimEnd()); | ||
|
||
return stringBuilder.ToString(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011"> | ||
<Metadata> | ||
<Identity Id="1ce34aed-d80b-4e02-afc9-bd0bd3848443" Version="1.7" Language="en-US" Publisher="Jakub Bielawa" /> | ||
<DisplayName>Line Endings Unifier</DisplayName> | ||
<Description xml:space="preserve">Unify line endings in a whole solution, a specific project, a chosen folder or a certain source file by right clicking on a solution, a project or a file in the Solution Explorer.</Description> | ||
<License>license.txt</License> | ||
</Metadata> | ||
<Installation> | ||
<InstallationTarget Id="Microsoft.VisualStudio.Community" Version="[11.0,15.0]" /> | ||
<InstallationTarget Version="[11.0,16.0)" Id="Microsoft.VisualStudio.Pro" /> | ||
<InstallationTarget Version="[11.0,16.0)" Id="Microsoft.VisualStudio.Enterprise" /> | ||
</Installation> | ||
<Dependencies> | ||
<Dependency Id="Microsoft.Framework.NDP" DisplayName="Microsoft .NET Framework" d:Source="Manual" Version="[4.5,)" /> | ||
<Dependency Id="Microsoft.VisualStudio.MPF.11.0" DisplayName="Visual Studio MPF 11.0" d:Source="Installed" Version="[11.0,12.0)" /> | ||
</Dependencies> | ||
<Prerequisites> | ||
<Prerequisite Id="Microsoft.VisualStudio.Component.CoreEditor" Version="[11.0,16.0)" DisplayName="Visual Studio core editor" /> | ||
</Prerequisites> | ||
<Assets> | ||
<Asset Type="Microsoft.VisualStudio.VsPackage" d:Source="Project" d:ProjectName="%CurrentProject%" Path="|%CurrentProject%;PkgdefProjectOutputGroup|" /> | ||
</Assets> | ||
<Metadata> | ||
<Identity Id="1ce34aed-d80b-4e02-afc9-bd0bd3848443" Version="1.8" Language="en-US" Publisher="Jakub Bielawa" /> | ||
<DisplayName>Line Endings Unifier</DisplayName> | ||
<Description xml:space="preserve">Unify line endings in a whole solution, a specific project, a chosen folder or a certain source file by right clicking on a solution, a project or a file in the Solution Explorer.</Description> | ||
<License>license.txt</License> | ||
</Metadata> | ||
<Installation> | ||
<InstallationTarget Id="Microsoft.VisualStudio.Community" Version="[11.0,15.0]" /> | ||
<InstallationTarget Version="[11.0,16.0)" Id="Microsoft.VisualStudio.Pro" /> | ||
<InstallationTarget Version="[11.0,16.0)" Id="Microsoft.VisualStudio.Enterprise" /> | ||
</Installation> | ||
<Dependencies> | ||
<Dependency Id="Microsoft.Framework.NDP" DisplayName="Microsoft .NET Framework" d:Source="Manual" Version="[4.5,)" /> | ||
<Dependency Id="Microsoft.VisualStudio.MPF.11.0" DisplayName="Visual Studio MPF 11.0" d:Source="Installed" Version="[11.0,12.0)" /> | ||
</Dependencies> | ||
<Prerequisites> | ||
<Prerequisite Id="Microsoft.VisualStudio.Component.CoreEditor" Version="[11.0,16.0)" DisplayName="Visual Studio core editor" /> | ||
</Prerequisites> | ||
<Assets> | ||
<Asset Type="Microsoft.VisualStudio.VsPackage" d:Source="Project" d:ProjectName="%CurrentProject%" Path="|%CurrentProject%;PkgdefProjectOutputGroup|" /> | ||
</Assets> | ||
</PackageManifest> |