Skip to content

Commit

Permalink
Merge pull request #71393 from CyrusNajmabadi/removeEnum
Browse files Browse the repository at this point in the history
  • Loading branch information
CyrusNajmabadi authored Dec 22, 2023
2 parents 99e1c4c + a3cb38b commit 944f84f
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 51 deletions.
55 changes: 19 additions & 36 deletions src/Workspaces/Core/Portable/Remote/WellKnownSynchronizationKind.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,46 +2,29 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

namespace Microsoft.CodeAnalysis.Serialization
{
internal enum WellKnownSynchronizationKind
{
// Start at a different value from 0 so that if we ever get 0 we know it's a bug.

SolutionState = 1,
ProjectState,
DocumentState,
namespace Microsoft.CodeAnalysis.Serialization;

ChecksumCollection,

SolutionAttributes,
ProjectAttributes,
DocumentAttributes,
SourceGeneratedDocumentIdentity,
internal enum WellKnownSynchronizationKind
{
// Start at a different value from 0 so that if we ever get 0 we know it's a bug.

CompilationOptions,
ParseOptions,
ProjectReference,
MetadataReference,
AnalyzerReference,
SourceText,
SolutionState = 1,
ProjectState,
DocumentState,

SerializableSourceText,
ChecksumCollection,

//
SolutionAttributes,
ProjectAttributes,
DocumentAttributes,
SourceGeneratedDocumentIdentity,

SyntaxTreeIndex,
SymbolTreeInfo,
CompilationOptions,
ParseOptions,
ProjectReference,
MetadataReference,
AnalyzerReference,
SourceText,

ProjectReferenceChecksumCollection,
MetadataReferenceChecksumCollection,
AnalyzerReferenceChecksumCollection,
TextDocumentChecksumCollection,
DocumentChecksumCollection,
AnalyzerConfigDocumentChecksumCollection,
ProjectChecksumCollection,
SolutionStateChecksums,
ProjectStateChecksums,
DocumentStateChecksums,
}
SerializableSourceText,
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,21 @@ internal static class SerializationExtensions
public static WellKnownSynchronizationKind GetWellKnownSynchronizationKind(this object value)
=> value switch
{
SolutionStateChecksums _ => WellKnownSynchronizationKind.SolutionState,
ProjectStateChecksums _ => WellKnownSynchronizationKind.ProjectState,
DocumentStateChecksums _ => WellKnownSynchronizationKind.DocumentState,
ChecksumCollection _ => WellKnownSynchronizationKind.ChecksumCollection,
SolutionInfo.SolutionAttributes _ => WellKnownSynchronizationKind.SolutionAttributes,
ProjectInfo.ProjectAttributes _ => WellKnownSynchronizationKind.ProjectAttributes,
DocumentInfo.DocumentAttributes _ => WellKnownSynchronizationKind.DocumentAttributes,
CompilationOptions _ => WellKnownSynchronizationKind.CompilationOptions,
ParseOptions _ => WellKnownSynchronizationKind.ParseOptions,
ProjectReference _ => WellKnownSynchronizationKind.ProjectReference,
MetadataReference _ => WellKnownSynchronizationKind.MetadataReference,
AnalyzerReference _ => WellKnownSynchronizationKind.AnalyzerReference,
SerializableSourceText _ => WellKnownSynchronizationKind.SerializableSourceText,
SourceText _ => WellKnownSynchronizationKind.SourceText,
SourceGeneratedDocumentIdentity _ => WellKnownSynchronizationKind.SourceGeneratedDocumentIdentity,
SolutionStateChecksums => WellKnownSynchronizationKind.SolutionState,
ProjectStateChecksums => WellKnownSynchronizationKind.ProjectState,
DocumentStateChecksums => WellKnownSynchronizationKind.DocumentState,
ChecksumCollection => WellKnownSynchronizationKind.ChecksumCollection,
SolutionInfo.SolutionAttributes => WellKnownSynchronizationKind.SolutionAttributes,
ProjectInfo.ProjectAttributes => WellKnownSynchronizationKind.ProjectAttributes,
DocumentInfo.DocumentAttributes => WellKnownSynchronizationKind.DocumentAttributes,
CompilationOptions => WellKnownSynchronizationKind.CompilationOptions,
ParseOptions => WellKnownSynchronizationKind.ParseOptions,
ProjectReference => WellKnownSynchronizationKind.ProjectReference,
MetadataReference => WellKnownSynchronizationKind.MetadataReference,
AnalyzerReference => WellKnownSynchronizationKind.AnalyzerReference,
SerializableSourceText => WellKnownSynchronizationKind.SerializableSourceText,
SourceText => WellKnownSynchronizationKind.SourceText,
SourceGeneratedDocumentIdentity => WellKnownSynchronizationKind.SourceGeneratedDocumentIdentity,
_ => throw ExceptionUtilities.UnexpectedValue(value),
};

Expand Down

0 comments on commit 944f84f

Please sign in to comment.