Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.2.0-4.final" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp.Workspaces" Version="4.4.0" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" PrivateAssets="all" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,16 +276,9 @@ protected override IEnumerable<CodeFixProvider> GetCodeFixProviders()
return new[] { codeFixProvider };
}

// TODO: Remove when c# 11 is a supported language version
// NOTE: If needed, this method can be temporarily updated to default to a preview version
private LanguageVersion? GetDefaultLanguageVersion()
{
// Temporary fix since c# 11 is not yet the default language version
// in the c# 11 test project.
if (LightupHelpers.SupportsCSharp11)
{
return LanguageVersionEx.Preview;
}

return null;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,16 +81,9 @@ protected override ParseOptions CreateParseOptions()
return parseOptions;
}

// TODO: Remove when c# 11 is a supported language version
// NOTE: If needed, this method can be temporarily updated to default to a preview version
private LanguageVersion? GetDefaultLanguageVersion()
{
// Temporary fix since c# 11 is not yet the default language version
// in the c# 11 test project.
if (LightupHelpers.SupportsCSharp11)
{
return LanguageVersionEx.Preview;
}

return null;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ internal static class LanguageVersionEx
public const LanguageVersion CSharp8 = (LanguageVersion)800;
public const LanguageVersion CSharp9 = (LanguageVersion)900;
public const LanguageVersion CSharp10 = (LanguageVersion)1000;
public const LanguageVersion CSharp11 = (LanguageVersion)1100;
public const LanguageVersion LatestMajor = (LanguageVersion)int.MaxValue - 2;
public const LanguageVersion Preview = (LanguageVersion)int.MaxValue - 1;
public const LanguageVersion Latest = (LanguageVersion)int.MaxValue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,8 @@ private static readonly ConcurrentDictionary<Type, ConcurrentDictionary<Operatio
public static bool SupportsCSharp10 { get; }
= Enum.GetNames(typeof(LanguageVersion)).Contains(nameof(LanguageVersionEx.CSharp10));

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

public static bool SupportsIOperation => SupportsCSharp73;

Expand Down