Skip to content

Commit 8e7f30d

Browse files
Updated Microsoft.CodeAnalysis.CSharp.Workspaces to version 4.4.0 for the c# 11 test project
1 parent 6478404 commit 8e7f30d

File tree

5 files changed

+5
-20
lines changed

5 files changed

+5
-20
lines changed

StyleCop.Analyzers/StyleCop.Analyzers.Test.CSharp11/StyleCop.Analyzers.Test.CSharp11.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
</PropertyGroup>
1818

1919
<ItemGroup>
20-
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.2.0-4.final" />
20+
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.4.0" />
2121
<PackageReference Include="xunit" Version="2.4.1" />
2222
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" PrivateAssets="all" />
2323
</ItemGroup>

StyleCop.Analyzers/StyleCop.Analyzers.Test/Verifiers/StyleCopCodeFixVerifier`2.cs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -276,16 +276,9 @@ protected override IEnumerable<CodeFixProvider> GetCodeFixProviders()
276276
return new[] { codeFixProvider };
277277
}
278278

279-
// TODO: Remove when c# 11 is a supported language version
279+
// NOTE: If needed, this method can be temporarily updated to default to a preview version
280280
private LanguageVersion? GetDefaultLanguageVersion()
281281
{
282-
// Temporary fix since c# 11 is not yet the default language version
283-
// in the c# 11 test project.
284-
if (LightupHelpers.SupportsCSharp11)
285-
{
286-
return LanguageVersionEx.Preview;
287-
}
288-
289282
return null;
290283
}
291284
}

StyleCop.Analyzers/StyleCop.Analyzers.Test/Verifiers/StyleCopDiagnosticVerifier`1.cs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,16 +81,9 @@ protected override ParseOptions CreateParseOptions()
8181
return parseOptions;
8282
}
8383

84-
// TODO: Remove when c# 11 is a supported language version
84+
// NOTE: If needed, this method can be temporarily updated to default to a preview version
8585
private LanguageVersion? GetDefaultLanguageVersion()
8686
{
87-
// Temporary fix since c# 11 is not yet the default language version
88-
// in the c# 11 test project.
89-
if (LightupHelpers.SupportsCSharp11)
90-
{
91-
return LanguageVersionEx.Preview;
92-
}
93-
9487
return null;
9588
}
9689
}

StyleCop.Analyzers/StyleCop.Analyzers/Lightup/LanguageVersionEx.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ internal static class LanguageVersionEx
1919
public const LanguageVersion CSharp8 = (LanguageVersion)800;
2020
public const LanguageVersion CSharp9 = (LanguageVersion)900;
2121
public const LanguageVersion CSharp10 = (LanguageVersion)1000;
22+
public const LanguageVersion CSharp11 = (LanguageVersion)1100;
2223
public const LanguageVersion LatestMajor = (LanguageVersion)int.MaxValue - 2;
2324
public const LanguageVersion Preview = (LanguageVersion)int.MaxValue - 1;
2425
public const LanguageVersion Latest = (LanguageVersion)int.MaxValue;

StyleCop.Analyzers/StyleCop.Analyzers/Lightup/LightupHelpers.cs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,8 @@ private static readonly ConcurrentDictionary<Type, ConcurrentDictionary<Operatio
4646
public static bool SupportsCSharp10 { get; }
4747
= Enum.GetNames(typeof(LanguageVersion)).Contains(nameof(LanguageVersionEx.CSharp10));
4848

49-
// NOTE: Since c# is only in preview yet, we need to check something else than available language versions. Picked a new syntax kind temporarily.
50-
// TODO: Update when c# 11 is available as a language version.
5149
public static bool SupportsCSharp11 { get; }
52-
= Enum.GetNames(typeof(SyntaxKind)).Contains(nameof(SyntaxKindEx.SlicePattern));
50+
= Enum.GetNames(typeof(LanguageVersion)).Contains(nameof(LanguageVersionEx.CSharp11));
5351

5452
public static bool SupportsIOperation => SupportsCSharp73;
5553

0 commit comments

Comments
 (0)