-
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.
- Loading branch information
1 parent
28a09e2
commit 87d0772
Showing
27 changed files
with
541 additions
and
186 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
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 4 additions & 2 deletions
6
CSafeRefactoring/CSafeRefactoring.Vsix/source.extension.vsixmanifest
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,18 @@ | ||
<?xml version="1.0"?> | ||
<package > | ||
<metadata> | ||
<id>$id$</id> | ||
<version>$version$</version> | ||
<title>$title$</title> | ||
<authors>$author$</authors> | ||
<owners>$author$</owners> | ||
<licenseUrl>http://LICENSE_URL_HERE_OR_DELETE_THIS_LINE</licenseUrl> | ||
<projectUrl>http://PROJECT_URL_HERE_OR_DELETE_THIS_LINE</projectUrl> | ||
<iconUrl>http://ICON_URL_HERE_OR_DELETE_THIS_LINE</iconUrl> | ||
<requireLicenseAcceptance>false</requireLicenseAcceptance> | ||
<description>$description$</description> | ||
<releaseNotes>Summary of changes made in this release of the package.</releaseNotes> | ||
<copyright>Copyright 2016</copyright> | ||
<tags>Tag1 Tag2</tags> | ||
</metadata> | ||
</package> |
33 changes: 33 additions & 0 deletions
33
CSafeRefactoring/CSafeRefactoring/CodeRefactoringProviderBase.cs
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,33 @@ | ||
using Microsoft.CodeAnalysis; | ||
using Microsoft.CodeAnalysis.CodeRefactorings; | ||
|
||
namespace CSafeRefactoring | ||
{ | ||
public abstract class CodeRefactoringProviderBase : CodeRefactoringProvider | ||
{ | ||
private const string ORDINAL_IGNORECASE = "Use StringComparison.OrdinalIgnoreCase"; | ||
private const string ORDINAL = "Use StringComparison.Ordinal"; | ||
|
||
private const string INVARIANTCULTURE_IGNORECASE = "Use StringComparison.InvariantCultureIgnoreCase"; | ||
private const string INVARIANTCULTURE = "Use StringComparison.InvariantCulture"; | ||
|
||
protected abstract string MethodToReplaceName { get; } | ||
|
||
protected abstract bool IgnoreCase { get; } | ||
|
||
protected string GetOrdinalMessage() | ||
{ | ||
return IgnoreCase ? ORDINAL_IGNORECASE : ORDINAL; | ||
} | ||
|
||
protected string GetInvariantCultureMessage() | ||
{ | ||
return IgnoreCase ? INVARIANTCULTURE_IGNORECASE : INVARIANTCULTURE; | ||
} | ||
|
||
protected bool IsCurrentNodeReplacedMethod(SyntaxNode node) | ||
{ | ||
return node.GetText().ToString() == MethodToReplaceName; | ||
} | ||
} | ||
} |
74 changes: 27 additions & 47 deletions
74
CSafeRefactoring/CSafeRefactoring/EqualsRefactoringBase.cs
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
Oops, something went wrong.