提交 a9434127 编写于 作者: C Cyrus Najmabadi

Rename

上级 09e286fa
......@@ -20,7 +20,7 @@
<Compile Include="$(MSBuildThisFileDirectory)AddRequiredParentheses\CSharpAddRequiredPatternParenthesesDiagnosticAnalyzer.cs" />
<Compile Include="$(MSBuildThisFileDirectory)RemoveUnnecessarySuppressions\CSharpRemoveUnnecessarySuppressionsDiagnosticAnalyzer.cs" />
<Compile Include="$(MSBuildThisFileDirectory)RemoveUnnecessaryParentheses\CSharpRemoveUnnecessaryPatternParenthesesDiagnosticAnalyzer.cs" />
<Compile Include="$(MSBuildThisFileDirectory)RemoveUnnecessarySuppression\CSharpRemoveUnnecessarySuppressionDiagnosticAnalyzer.cs" />
<Compile Include="$(MSBuildThisFileDirectory)RemoveConfusingSuppression\CSharpRemoveConfusingSuppressionDiagnosticAnalyzer.cs" />
<Compile Include="..\..\..\Analyzers\CSharp\Analyzers\AddRequiredParentheses\CSharpAddRequiredExpressionParenthesesDiagnosticAnalyzer.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ConvertAnonymousTypeToTuple\CSharpConvertAnonymousTypeToTupleDiagnosticAnalyzer.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ConvertSwitchStatementToExpression\ConvertSwitchStatementToExpressionConstants.cs" />
......
......@@ -10,13 +10,13 @@
using Microsoft.CodeAnalysis.Diagnostics;
using Roslyn.Utilities;
namespace Microsoft.CodeAnalysis.CSharp.RemoveUnnecessarySuppression
namespace Microsoft.CodeAnalysis.CSharp.RemoveConfusingSuppression
{
[DiagnosticAnalyzer(LanguageNames.CSharp)]
internal class CSharpRemoveUnnecessarySuppressionDiagnosticAnalyzer : AbstractCodeStyleDiagnosticAnalyzer
internal class CSharpRemoveConfusingSuppressionDiagnosticAnalyzer : AbstractCodeStyleDiagnosticAnalyzer
{
public CSharpRemoveUnnecessarySuppressionDiagnosticAnalyzer()
: base(IDEDiagnosticIds.RemoveUnnecessarySuppressionForIsExpressionDiagnosticId,
public CSharpRemoveConfusingSuppressionDiagnosticAnalyzer()
: base(IDEDiagnosticIds.RemoveConfusingSuppressionForIsExpressionDiagnosticId,
new LocalizableResourceString(nameof(CSharpAnalyzersResources.Remove_unnecessary_suppression_operator), CSharpAnalyzersResources.ResourceManager, typeof(CSharpAnalyzersResources)),
new LocalizableResourceString(nameof(CSharpAnalyzersResources.Suppression_operator_has_no_effect_and_can_be_misinterpreted), CSharpAnalyzersResources.ResourceManager, typeof(CSharpAnalyzersResources)))
{
......
......@@ -30,8 +30,8 @@
<Compile Include="$(MSBuildThisFileDirectory)QualifyMemberAccess\CSharpQualifyMemberAccessCodeFixProvider.cs" />
<Compile Include="$(MSBuildThisFileDirectory)RemoveUnnecessaryCast\CSharpRemoveUnnecessaryCastCodeFixProvider.cs" />
<Compile Include="$(MSBuildThisFileDirectory)RemoveUnnecessaryImports\CSharpRemoveUnnecessaryImportsCodeFixProvider.cs" />
<Compile Include="$(MSBuildThisFileDirectory)RemoveUnnecessarySuppression\CSharpRemoveUnnecessarySuppressionCodeFixProvider.cs" />
<Compile Include="$(MSBuildThisFileDirectory)RemoveUnnecessarySuppression\CSharpRemoveUnnecessarySuppressionFixAllProvider.cs" />
<Compile Include="$(MSBuildThisFileDirectory)RemoveConfusingSuppression\CSharpRemoveConfusingSuppressionCodeFixProvider.cs" />
<Compile Include="$(MSBuildThisFileDirectory)RemoveConfusingSuppression\CSharpRemoveConfusingSuppressionFixAllProvider.cs" />
<Compile Include="$(MSBuildThisFileDirectory)RemoveUnreachableCode\CSharpRemoveUnreachableCodeCodeFixProvider.cs" />
<Compile Include="$(MSBuildThisFileDirectory)RemoveUnnecessaryParentheses\CSharpRemoveUnnecessaryParenthesesCodeFixProvider.cs" />
<Compile Include="$(MSBuildThisFileDirectory)RemoveUnusedMembers\CSharpRemoveUnusedMembersCodeFixProvider.cs" />
......
......@@ -20,25 +20,25 @@
using Microsoft.CodeAnalysis.Shared.Extensions;
using Roslyn.Utilities;
namespace Microsoft.CodeAnalysis.CSharp.RemoveUnnecessarySuppression
namespace Microsoft.CodeAnalysis.CSharp.RemoveConfusingSuppression
{
[ExportCodeFixProvider(LanguageNames.CSharp), Shared]
internal sealed partial class CSharpRemoveUnnecessarySuppressionCodeFixProvider : CodeFixProvider
internal sealed partial class CSharpRemoveConfusingSuppressionCodeFixProvider : CodeFixProvider
{
public const string RemoveOperator = nameof(RemoveOperator);
public const string NegateExpression = nameof(NegateExpression);
[ImportingConstructor]
[Obsolete(MefConstruction.ImportingConstructorMessage, error: true)]
public CSharpRemoveUnnecessarySuppressionCodeFixProvider()
public CSharpRemoveConfusingSuppressionCodeFixProvider()
{
}
public override ImmutableArray<string> FixableDiagnosticIds
=> ImmutableArray.Create(IDEDiagnosticIds.RemoveUnnecessarySuppressionForIsExpressionDiagnosticId);
=> ImmutableArray.Create(IDEDiagnosticIds.RemoveConfusingSuppressionForIsExpressionDiagnosticId);
public override FixAllProvider GetFixAllProvider()
=> new CSharpRemoveUnnecessarySuppressionFixAllProvider();
=> new CSharpRemoveConfusingSuppressionFixAllProvider();
public override Task RegisterCodeFixesAsync(CodeFixContext context)
{
......
......@@ -8,13 +8,13 @@
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.CodeFixes;
namespace Microsoft.CodeAnalysis.CSharp.RemoveUnnecessarySuppression
namespace Microsoft.CodeAnalysis.CSharp.RemoveConfusingSuppression
{
internal partial class CSharpRemoveUnnecessarySuppressionCodeFixProvider
internal partial class CSharpRemoveConfusingSuppressionCodeFixProvider
{
private class CSharpRemoveUnnecessarySuppressionFixAllProvider : DocumentBasedFixAllProvider
private class CSharpRemoveConfusingSuppressionFixAllProvider : DocumentBasedFixAllProvider
{
public CSharpRemoveUnnecessarySuppressionFixAllProvider()
public CSharpRemoveConfusingSuppressionFixAllProvider()
{
}
......
......@@ -25,7 +25,7 @@
<Compile Include="$(MSBuildThisFileDirectory)MisplacedUsingDirectives\MisplacedUsingDirectivesCodeFixProviderTests.cs" />
<Compile Include="$(MSBuildThisFileDirectory)OrderModifiers\OrderModifiersCompilerErrorTests.cs" />
<Compile Include="$(MSBuildThisFileDirectory)OrderModifiers\OrderModifiersTests.cs" />
<Compile Include="$(MSBuildThisFileDirectory)RemoveUnnecessarySuppression\RemoveUnnecessarySuppressionTests.cs" />
<Compile Include="$(MSBuildThisFileDirectory)RemoveConfusingSuppression\RemoveConfusingSuppressionTests.cs" />
<Compile Include="$(MSBuildThisFileDirectory)UpdateLegacySuppressions\UpdateLegacySuppressionsTests.cs" />
<Compile Include="$(MSBuildThisFileDirectory)RemoveUnnecessarySuppressions\RemoveUnnecessarySuppressionsTests.cs" />
<Compile Include="$(MSBuildThisFileDirectory)RemoveUnnecessaryParentheses\RemoveUnnecessaryPatternParenthesesTests.cs" />
......
......@@ -4,17 +4,17 @@
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.RemoveUnnecessarySuppression;
using Microsoft.CodeAnalysis.CSharp.RemoveConfusingSuppression;
using Microsoft.CodeAnalysis.CSharp.Shared.Extensions;
using Microsoft.CodeAnalysis.Editor.UnitTests.CodeActions;
using Roslyn.Test.Utilities;
using Xunit;
namespace Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.RemoveUnnecessarySuppression
namespace Microsoft.CodeAnalysis.Editor.CSharp.UnitTests.Confusing
{
using VerifyCS = CSharpCodeFixVerifier<CSharpRemoveUnnecessarySuppressionDiagnosticAnalyzer, CSharpRemoveUnnecessarySuppressionCodeFixProvider>;
using VerifyCS = CSharpCodeFixVerifier<CSharpRemoveConfusingSuppressionDiagnosticAnalyzer, CSharpRemoveConfusingSuppressionCodeFixProvider>;
public class RemoveUnnecessarySuppressionTests
public class RemoveConfusingSuppressionTests
{
[Fact, WorkItem(44872, "https://github.com/dotnet/roslyn/issues/44872")]
public async Task TestRemoveWithIsExpression1()
......@@ -240,7 +240,7 @@ void M(object o)
}
}",
NumberOfFixAllIterations = 1,
CodeActionEquivalenceKey = CSharpRemoveUnnecessarySuppressionCodeFixProvider.RemoveOperator,
CodeActionEquivalenceKey = CSharpRemoveConfusingSuppressionCodeFixProvider.RemoveOperator,
}.RunAsync();
}
......@@ -278,7 +278,7 @@ void M(object o)
}
}",
CodeActionIndex = 1,
CodeActionEquivalenceKey = CSharpRemoveUnnecessarySuppressionCodeFixProvider.NegateExpression,
CodeActionEquivalenceKey = CSharpRemoveConfusingSuppressionCodeFixProvider.NegateExpression,
NumberOfFixAllIterations = 1,
}.RunAsync();
}
......@@ -317,7 +317,7 @@ void M(object o)
}
}",
NumberOfFixAllIterations = 1,
CodeActionEquivalenceKey = CSharpRemoveUnnecessarySuppressionCodeFixProvider.RemoveOperator,
CodeActionEquivalenceKey = CSharpRemoveConfusingSuppressionCodeFixProvider.RemoveOperator,
}.RunAsync();
}
......@@ -356,7 +356,7 @@ void M(object o)
}",
NumberOfFixAllIterations = 1,
CodeActionIndex = 1,
CodeActionEquivalenceKey = CSharpRemoveUnnecessarySuppressionCodeFixProvider.NegateExpression,
CodeActionEquivalenceKey = CSharpRemoveConfusingSuppressionCodeFixProvider.NegateExpression,
}.RunAsync();
}
}
......
......@@ -133,7 +133,7 @@ internal static class IDEDiagnosticIds
public const string InvalidSuppressMessageAttributeDiagnosticId = "IDE0076";
public const string LegacyFormatSuppressMessageAttributeDiagnosticId = "IDE0077";
public const string RemoveUnnecessarySuppressionForIsExpressionDiagnosticId = "IDE0080";
public const string RemoveConfusingSuppressionForIsExpressionDiagnosticId = "IDE0080";
// Analyzer error Ids
public const string AnalyzerChangedId = "IDE1001";
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册