diff --git a/src/PlantUmlClassDiagramGenerator.SourceGenerator/PlantUmlClassDiagramGenerator.SourceGenerator.csproj b/src/PlantUmlClassDiagramGenerator.SourceGenerator/PlantUmlClassDiagramGenerator.SourceGenerator.csproj index 37c36be..d4907f4 100644 --- a/src/PlantUmlClassDiagramGenerator.SourceGenerator/PlantUmlClassDiagramGenerator.SourceGenerator.csproj +++ b/src/PlantUmlClassDiagramGenerator.SourceGenerator/PlantUmlClassDiagramGenerator.SourceGenerator.csproj @@ -24,14 +24,15 @@ README.md git plantuml;SourceGenerator - [1.0.0] -- Added `DisableAssociationTypes` property to `PlantUmlDiagramAttribute`. -- Fixed behavior when setting `IncludeMemberAccessibilities` and `ExcludeMemberAccessibilities` properties of `PlantUmlDiagramAttribute`. + +[1.1.0] +- Suppress the compiler-generated members of record types in source generator. +- Added ".g" to attribute filenames to indicate generated code and resolved code analysis warnings. MIT - 1.0.0.0 - 1.0.0.0 - 1.0.0 + 1.1.0.0 + 1.1.0.0 + 1.1.0 diff --git a/src/PlantUmlClassDiagramGenerator.SourceGenerator/README.md b/src/PlantUmlClassDiagramGenerator.SourceGenerator/README.md index 2c5f759..a6189e7 100644 --- a/src/PlantUmlClassDiagramGenerator.SourceGenerator/README.md +++ b/src/PlantUmlClassDiagramGenerator.SourceGenerator/README.md @@ -458,6 +458,11 @@ abstract class AbstractClass public abstract void MethodB(); } +interface IInterfaceA +{ + void MethodA(); +} + record RecordA(string Name,int Value); public struct StructA() @@ -512,20 +517,12 @@ abstract class AbstractClass { + {abstract} MethodB() : void # AbstractClass() } +interface IInterfaceA { + + MethodA() : void +} class RecordA <> { - + RecordA(Name : string, Value : int) - # <> <> EqualityContract : Type <> + Name : string <> <> + Value : int <> <> - + <> ToString() : string - # <> PrintMembers(builder : StringBuilder) : bool - + {static} operator !=(left : RecordA?, right : RecordA?) : bool - + {static} operator ==(left : RecordA?, right : RecordA?) : bool - + <> GetHashCode() : int - + <> Equals(obj : object?) : bool - + <> Equals(other : RecordA?) : bool - # RecordA(original : RecordA) - + Deconstruct(Name : string, Value : int) : void } struct StructA <> { + StructA() @@ -534,19 +531,9 @@ struct StructA <> { + Z : float <> <> } struct RecordStruct <> <> { - + RecordStruct(X : float, Y : float, Z : float) + X : float <> <> + Y : float <> <> + Z : float <> <> - + <> <> ToString() : string - - <> PrintMembers(builder : StringBuilder) : bool - + {static} operator !=(left : RecordStruct, right : RecordStruct) : bool - + {static} operator ==(left : RecordStruct, right : RecordStruct) : bool - + <> <> GetHashCode() : int - + <> <> Equals(obj : object) : bool - + <> Equals(other : RecordStruct) : bool - + <> Deconstruct(X : float, Y : float, Z : float) : void - + RecordStruct() } enum LogLevel <> { Trace = 0 @@ -572,7 +559,7 @@ enum Accessibilities <> <> { -![types](/uml/source-generator/0302-005.svg) +![types](/uml/source-generator/Types.svg) ## 3. Associations @@ -1142,21 +1129,9 @@ enum LogLevel <> { ``` @startuml Item class Item <> { - + Item(Name : string, Value : double) - # <> <> EqualityContract : Type <> + Name : string <> <> + Value : double <> <> - + <> ToString() : string - # <> PrintMembers(builder : StringBuilder) : bool - + {static} operator !=(left : Item?, right : Item?) : bool - + {static} operator ==(left : Item?, right : Item?) : bool - + <> GetHashCode() : int - + <> Equals(obj : object?) : bool - + <> Equals(other : Item?) : bool - # Item(original : Item) - + Deconstruct(Name : string, Value : double) : void -} -"IEquatable`1" "" <|.. Item +} @enduml ``` @@ -1174,28 +1149,24 @@ struct StructA <> { ``` @startuml Parameters class Parameters <> { - # <> <> EqualityContract : Type <> + <> X : int <> + <> Y : int <> + Parameters(x : int, y : int) + Area() : int - + <> ToString() : string - # <> PrintMembers(builder : StringBuilder) : bool - + {static} operator !=(left : Parameters?, right : Parameters?) : bool - + {static} operator ==(left : Parameters?, right : Parameters?) : bool - + <> GetHashCode() : int - + <> Equals(obj : object?) : bool - + <> Equals(other : Parameters?) : bool # Parameters(original : Parameters) } -"IEquatable`1" "" <|.. Parameters @enduml ``` -![Example2](/uml/source-generator/0302-014.svg) +![Example2](/uml/source-generator/SampleModel.svg) ## Release Notes + +### [1.1.0] +- Suppress the compiler-generated members of record types in source generator. +- Added ".g" to attribute filenames to indicate generated code and resolved code analysis warnings. + ### [1.0.0] - Added `DisableAssociationTypes` property to `PlantUmlDiagramAttribute`. - Fixed behavior when setting `IncludeMemberAccessibilities` and `ExcludeMemberAccessibilities` properties of `PlantUmlDiagramAttribute`. diff --git a/uml/source-generator/SampleModel.svg b/uml/source-generator/SampleModel.svg new file mode 100644 index 0000000..467339d --- /dev/null +++ b/uml/source-generator/SampleModel.svg @@ -0,0 +1 @@ +ILoggerWrite(message : string, logLevel : LogLevel, exception : Exception) : voidWriteTrace(message : string) : voidWriteDebug(message : string) : voidWriteInfo(message : string) : voidWriteWarn(message : string) : voidWriteError(message : string, exception : Exception) : voidWriteFatal(message : string, exception : Exception) : void«sealed»LogLevelTrace = 0Debug = 1Info = 2Warn = 3Error = 4Fatal = 5LogLevel()«record»ItemName : string «get» «set»Value : double «get» «set»«sealed»StructAX : float «get» «set»Y : float «get» «set»Z : float «get» «set»«record»Parameters«readonly» X : int «get»«readonly» Y : int «get»Area() : intSampleModel«readonly» logger : ILogger«readonly» structures : IList<StructA>«readonly» Items : IReadOnlyList<Item> «get»SampleModel(logger : ILogger, structures : IList<StructA>)«async» Execute(parameters : Parameters) : ValueTaskLoggerWrite(message : string, logLevel : LogLevel, exception : Exception?) : voidWriteDebug(message : string) : voidWriteInfo(message : string) : voidWriteTrace(message : string) : voidWriteWarn(message : string) : voidWriteError(message : string, exception : Exception?) : voidWriteFatal(message : string, exception : Exception?) : voidLogger()loggerstructures*Items* \ No newline at end of file diff --git a/uml/source-generator/Types.svg b/uml/source-generator/Types.svg new file mode 100644 index 0000000..4876ee4 --- /dev/null +++ b/uml/source-generator/Types.svg @@ -0,0 +1 @@ +ClassA«readonly» Name : string «get»«readonly» Value : int «get»ClassA(name : string, value : int)«static»StaticClassSpecificName : stringPiyo(count : int) : stringStaticClass()AbstractClassMethodA() : voidMethodB() : voidAbstractClass()IInterfaceAMethodA() : void«record»RecordAName : string «get» «set»Value : int «get» «set»«sealed»StructAX : float «get» «set»Y : float «get» «set»Z : float «get» «set»StructA()«sealed»«record»RecordStructX : float «get» «set»Y : float «get» «set»Z : float «get» «set»«sealed»LogLevelTrace = 0Debug = 1Info = 2Warn = 3Error = 4Fatal = 5LogLevel()«Flags»«sealed»AccessibilitiesNone = 0Public = 1Protected = 2Internal = 4ProtectedInternal = 8PrivateProtected = 16Private = 32All = Public | Protected | Internal | ProtectedInternal | PrivateProtected | PrivateAccessibilities() \ No newline at end of file