@@ -11,6 +11,8 @@ public void RegisterAttributes(IncrementalGeneratorInitializationContext context
11
11
context . RegisterPostInitializationOutput ( context =>
12
12
{
13
13
const string source = """
14
+ #nullable enable
15
+
14
16
namespace PlantUmlClassDiagramGenerator.SourceGenerator.Attributes;
15
17
16
18
[global::System.Flags]
@@ -47,7 +49,7 @@ internal enum AssociationTypes
47
49
| global::System.AttributeTargets.Interface
48
50
| global::System.AttributeTargets.Enum
49
51
| global::System.AttributeTargets.Struct)]
50
- internal class PlantUmlDiagramAttribute : global::System.Attribute
52
+ internal sealed class PlantUmlDiagramAttribute : global::System.Attribute
51
53
{
52
54
public Accessibilities IncludeMemberAccessibilities { get; set; } = Accessibilities.NotSet;
53
55
public Accessibilities ExcludeMemberAccessibilities { get; set; } = Accessibilities.NotSet;
@@ -65,7 +67,7 @@ internal class PlantUmlDiagramAttribute : global::System.Attribute
65
67
| global::System.AttributeTargets.Event
66
68
| global::System.AttributeTargets.Interface
67
69
| global::System.AttributeTargets.Parameter)]
68
- internal class PlantUmlIgnoreAttribute : global::System.Attribute
70
+ internal sealed class PlantUmlIgnoreAttribute : global::System.Attribute
69
71
{ }
70
72
71
73
[global::System.AttributeUsage(
@@ -79,7 +81,7 @@ internal class PlantUmlIgnoreAttribute : global::System.Attribute
79
81
| global::System.AttributeTargets.Event
80
82
| global::System.AttributeTargets.Interface
81
83
| global::System.AttributeTargets.Parameter)]
82
- internal class PlantUmlAssociationAttribute(string node) : global::System.Attribute
84
+ internal sealed class PlantUmlAssociationAttribute(string node) : global::System.Attribute
83
85
{
84
86
public string Node { get;} = node;
85
87
@@ -100,7 +102,7 @@ internal class PlantUmlAssociationAttribute(string node) : global::System.Attrib
100
102
| global::System.AttributeTargets.Event
101
103
| global::System.AttributeTargets.Interface
102
104
| global::System.AttributeTargets.Parameter)]
103
- internal class PlantUmlIgnoreAssociationAttribute : global::System.Attribute
105
+ internal sealed class PlantUmlIgnoreAssociationAttribute : global::System.Attribute
104
106
{ }
105
107
106
108
[global::System.AttributeUsage(
@@ -109,12 +111,12 @@ internal class PlantUmlIgnoreAssociationAttribute : global::System.Attribute
109
111
| global::System.AttributeTargets.Interface
110
112
| global::System.AttributeTargets.Enum
111
113
| global::System.AttributeTargets.Struct)]
112
- internal class PlantUmlExtraAssociationTargetsAttribute(params global::System.Type[] types ) : global::System.Attribute
114
+ internal sealed class PlantUmlExtraAssociationTargetsAttribute(params global::System.Type[] types ) : global::System.Attribute
113
115
{
114
116
public global::System.Type[] Types { get; } = types;
115
117
}
116
118
""" ;
117
- context . AddSource ( "Attributes" , SourceText . From ( source , Encoding . UTF8 ) ) ;
119
+ context . AddSource ( "Attributes.g " , SourceText . From ( source , Encoding . UTF8 ) ) ;
118
120
} ) ;
119
121
}
120
122
}
0 commit comments