Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #7008 Make AnalyzerOptionsExtensions to have public modifier instead of internal #7085

Merged
merged 5 commits into from
Jan 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions src/Test.Utilities/Test.Utilities.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
<!-- Excluded from source build. Otherwise this should be conditionalized to only be set when DotNetBuildFromSource != true -->
<MicrosoftCodeAnalysisVersion>$(MicrosoftCodeAnalysisVersionForToolsAndUtilities)</MicrosoftCodeAnalysisVersion>
</PropertyGroup>
<PropertyGroup>
<DefineConstants>TEST_UTILITIES</DefineConstants>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.VisualBasic" Version="$(MicrosoftVisualBasicVersion)" />
<PackageReference Include="Microsoft.CodeAnalysis" Version="$(MicrosoftCodeAnalysisVersion)" />
Expand Down
4 changes: 4 additions & 0 deletions src/Utilities/Compiler/Options/AnalyzerOptionsExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@

namespace Analyzer.Utilities
{
#if !TEST_UTILITIES
public static partial class AnalyzerOptionsExtensions
#else
internal static partial class AnalyzerOptionsExtensions
#endif
{
private static readonly ConditionalWeakTable<AnalyzerOptions, ICategorizedAnalyzerConfigOptions> s_cachedOptions = new();
private static readonly ImmutableHashSet<OutputKind> s_defaultOutputKinds =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Analyzer.Utilities.Options
{
internal enum EnumValuesPrefixTrigger
public enum EnumValuesPrefixTrigger
{
// NOTE: Below fields names are used in the .editorconfig specification.
// Hence the names should *not* be modified, as that would be a breaking
Expand Down
2 changes: 1 addition & 1 deletion src/Utilities/Compiler/Options/SymbolModifiers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace Analyzer.Utilities
/// Describes a group of modifiers for symbol declaration.
/// </summary>
[Flags]
internal enum SymbolModifiers
public enum SymbolModifiers
{
// NOTE: Below fields names are used in the .editorconfig specification
// for symbol modifiers analyzer option. Hence the names should *not* be modified,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@

namespace Analyzer.Utilities
{
internal sealed class SymbolNamesWithValueOption<TValue> : IEquatable<SymbolNamesWithValueOption<TValue>?>
#if !TEST_UTILITIES
public sealed class SymbolNamesWithValueOption<TValue>
#else
internal sealed class SymbolNamesWithValueOption<TValue>
#endif
: IEquatable<SymbolNamesWithValueOption<TValue>?>
{
internal const SymbolKind AllKinds = SymbolKind.ErrorType;
internal const char WildcardChar = '*';
Expand Down Expand Up @@ -381,7 +386,9 @@ internal TestAccessor(SymbolNamesWithValueOption<TValue> symbolNamesWithValueOpt
/// On the rule CA1710, we allow user specific suffix to be registered for symbol names using the following format:
/// MyClass->Suffix or T:MyNamespace.MyClass->Suffix or N:MyNamespace->Suffix.
/// </example>
#pragma warning disable CA1034 // Nested types should not be visible
public sealed class NameParts
#pragma warning restore CA1034 // Nested types should not be visible
{
public NameParts(string symbolName, TValue associatedValue)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Utilities/Compiler/Options/SymbolVisibilityGroup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace Analyzer.Utilities
/// </summary>
[Flags]
#pragma warning disable CA1714 // Flags enums should have plural names
internal enum SymbolVisibilityGroup
public enum SymbolVisibilityGroup
#pragma warning restore CA1714 // Flags enums should have plural names
{
// NOTE: Below fields names are used in the .editorconfig specification
Expand Down
7 changes: 6 additions & 1 deletion src/Utilities/Compiler/Options/Unit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@ namespace Analyzer.Utilities
/// <remarks>
/// This class is a duplicate from "https://github.com/dotnet/reactive/blob/main/Rx.NET/Source/src/System.Reactive/Unit.cs
/// </remarks>
internal struct Unit : IEquatable<Unit>
#if !TEST_UTILITIES
public struct Unit
#else
internal struct Unit
#endif
: IEquatable<Unit>
{
/// <summary>
/// Determines whether the specified <see cref="Unit"/> value is equal to the current <see cref="Unit"/>. Because <see cref="Unit"/> has a single value, this always returns <c>true</c>.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace Analyzer.Utilities
{
internal static partial class AnalyzerOptionsExtensions
public static partial class AnalyzerOptionsExtensions
{
public static InterproceduralAnalysisKind GetInterproceduralAnalysisKindOption(
this AnalyzerOptions options,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace Analyzer.Utilities
/// <summary>
/// Describes a group of effective <see cref="SymbolVisibility"/> for symbols.
/// </summary>
internal enum DisposeAnalysisKind
public enum DisposeAnalysisKind
{
// NOTE: Below fields names are used in the .editorconfig specification
// for DisposeAnalysisKind option. Hence the names should *not* be modified,
Expand Down