Skip to content

Commit cef31f9

Browse files
committed
Roll back to Roslyn 4.0.1, to match up against Visual Studio 2022 RTM
1 parent ed82d71 commit cef31f9

5 files changed

Lines changed: 9 additions & 6 deletions

File tree

src/Directory.Build.props

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,7 @@
2323
</PropertyGroup>
2424

2525
<ItemGroup>
26-
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4" PrivateAssets="all" />
27-
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.6.0" />
26+
<PackageReference Include="Microsoft.CodeAnalysis" Version="4.0.1" />
2827
<PackageReference Include="Microsoft.SourceLink.GitHub" Version="1.1.1" PrivateAssets="all" />
2928
<PackageReference Include="Nerdbank.GitVersioning" Version="3.6.133">
3029
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>

src/xunit.analyzers.fixes/xunit.analyzers.fixes.csproj

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@
55
<TargetFramework>netstandard2.0</TargetFramework>
66
</PropertyGroup>
77

8-
<ItemGroup>
9-
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.6.0" />
10-
</ItemGroup>
11-
128
<ItemGroup>
139
<ProjectReference Include="..\xunit.analyzers\xunit.analyzers.csproj" />
1410
</ItemGroup>

src/xunit.analyzers/X1000/TestMethodCannotHaveOverloads.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,15 @@ public override void AnalyzeCompilation(
2525
if (typeSymbol.TypeKind != TypeKind.Class)
2626
return;
2727

28+
#pragma warning disable RS1024 // Compare symbols correctly
2829
var methodsByName =
2930
typeSymbol
3031
.GetInheritedAndOwnMembers()
3132
.Where(s => s.Kind == SymbolKind.Method)
3233
.Cast<IMethodSymbol>()
3334
.Where(m => m.MethodKind == MethodKind.Ordinary)
3435
.GroupBy(m => m.Name);
36+
#pragma warning restore RS1024 // Compare symbols correctly
3537

3638
foreach (var grouping in methodsByName)
3739
{

src/xunit.analyzers/X1000/TestMethodMustNotHaveMultipleFactAttributes.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ public override void AnalyzeCompilation(
2424
if (context.Symbol is not IMethodSymbol symbol)
2525
return;
2626

27+
#pragma warning disable RS1024 // Compare symbols correctly
2728
var attributeTypes = new HashSet<INamedTypeSymbol>(SymbolEqualityComparer.Default);
29+
#pragma warning restore RS1024 // Compare symbols correctly
2830

2931
var count = 0;
3032

@@ -39,13 +41,15 @@ public override void AnalyzeCompilation(
3941
}
4042

4143
if (count > 1)
44+
#pragma warning disable RS1024 // Compare symbols correctly
4245
context.ReportDiagnostic(
4346
Diagnostic.Create(
4447
Descriptors.X1002_TestMethodMustNotHaveMultipleFactAttributes,
4548
symbol.Locations.First(),
4649
properties: attributeTypes.ToImmutableDictionary(t => t.ToDisplayString(), t => (string?)string.Empty)
4750
)
4851
);
52+
#pragma warning restore RS1024 // Compare symbols correctly
4953
}, SymbolKind.Method);
5054
}
5155
}

src/xunit.analyzers/X1000/TheoryMethodShouldUseAllParameters.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@ static void AnalyzeTheoryParameters(
5555
if (!flowAnalysis.Succeeded)
5656
return;
5757

58+
#pragma warning disable RS1024 // Compare symbols correctly
5859
var usedParameters = new HashSet<ISymbol>(flowAnalysis.ReadInside.Concat(flowAnalysis.Captured).Distinct(SymbolEqualityComparer.Default), SymbolEqualityComparer.Default);
60+
#pragma warning restore RS1024 // Compare symbols correctly
5961

6062
for (var i = 0; i < methodSymbol.Parameters.Length; i++)
6163
{

0 commit comments

Comments
 (0)