@@ -98,18 +98,42 @@ private void GenerateSource(SourceProductionContext spc, INamedTypeSymbol enumSy
9898 sourceBuilder . AppendLine ( ) ;
9999
100100 // Generate class
101+ sourceBuilder . AppendLine ( $ "/// <summary>") ;
102+ sourceBuilder . AppendLine ( $ "/// Data class for <see cref=\" { enumFullName } \" />") ;
103+ sourceBuilder . AppendLine ( $ "/// </summary>") ;
101104 sourceBuilder . AppendLine ( $ "[System.CodeDom.Compiler.GeneratedCode(\" { nameof ( EnumSourceGenerator ) } \" , \" { PackageVersion } \" )]") ;
102105 sourceBuilder . AppendLine ( $ "public class { enumDataClassName } ") ;
103106 sourceBuilder . AppendLine ( "{" ) ;
104107
105108 // Generate properties
109+ sourceBuilder . AppendLine ( $ "{ tabString } /// <summary>") ;
110+ sourceBuilder . AppendLine ( $ "{ tabString } /// The value of the enum") ;
111+ sourceBuilder . AppendLine ( $ "{ tabString } /// </summary>") ;
106112 sourceBuilder . AppendLine ( $ "{ tabString } public { enumName } Value {{ get; private init; }}") ;
113+ sourceBuilder . AppendLine ( ) ;
114+
115+ sourceBuilder . AppendLine ( $ "{ tabString } /// <summary>") ;
116+ sourceBuilder . AppendLine ( $ "{ tabString } /// The display text of the enum value") ;
117+ sourceBuilder . AppendLine ( $ "{ tabString } /// </summary>") ;
107118 sourceBuilder . AppendLine ( $ "{ tabString } public string Display {{ get; set; }}") ;
119+ sourceBuilder . AppendLine ( ) ;
120+
121+ sourceBuilder . AppendLine ( $ "{ tabString } /// <summary>") ;
122+ sourceBuilder . AppendLine ( $ "{ tabString } /// The localization key of the enum value") ;
123+ sourceBuilder . AppendLine ( $ "{ tabString } /// </summary>") ;
108124 sourceBuilder . AppendLine ( $ "{ tabString } public string LocalizationKey {{ get; set; }}") ;
125+ sourceBuilder . AppendLine ( ) ;
126+
127+ sourceBuilder . AppendLine ( $ "{ tabString } /// <summary>") ;
128+ sourceBuilder . AppendLine ( $ "{ tabString } /// The localization value of the enum value") ;
129+ sourceBuilder . AppendLine ( $ "{ tabString } /// </summary>") ;
109130 sourceBuilder . AppendLine ( $ "{ tabString } public string LocalizationValue {{ get; set; }}") ;
110131 sourceBuilder . AppendLine ( ) ;
111132
112133 // Generate GetValues method
134+ sourceBuilder . AppendLine ( $ "{ tabString } /// <summary>") ;
135+ sourceBuilder . AppendLine ( $ "{ tabString } /// Get all values of <see cref=\" { enumFullName } \" />") ;
136+ sourceBuilder . AppendLine ( $ "{ tabString } /// </summary>") ;
113137 sourceBuilder . AppendLine ( $ "{ tabString } public static List<{ enumDataClassName } > GetValues()") ;
114138 sourceBuilder . AppendLine ( $ "{ tabString } {{") ;
115139 sourceBuilder . AppendLine ( $ "{ tabString } { tabString } return new List<{ enumDataClassName } >") ;
@@ -171,6 +195,10 @@ private static void GenerateEnumField(StringBuilder sb, EnumField enumField, str
171195
172196 private static void GenerateUpdateLabelsMethod ( StringBuilder sb , string enumDataClassName , string tabString )
173197 {
198+ sb . AppendLine ( $ "{ tabString } /// <summary>") ;
199+ sb . AppendLine ( $ "{ tabString } /// Update the labels of the enum values when culture info changes.") ;
200+ sb . AppendLine ( $ "{ tabString } /// See <see cref=\" PluginInitContext.CultureInfoChanged\" /> for more details") ;
201+ sb . AppendLine ( $ "{ tabString } /// </summary>") ;
174202 sb . AppendLine ( $ "{ tabString } public static void UpdateLabels(List<{ enumDataClassName } > options)") ;
175203 sb . AppendLine ( $ "{ tabString } {{") ;
176204 sb . AppendLine ( $ "{ tabString } { tabString } foreach (var item in options)") ;
0 commit comments