com.wallstop-studios.dxmessaging 2.0.0-rc26.3 → 2.0.0-rc26.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Editor/Analyzers/WallstopStudios.DxMessaging.SourceGenerators.dll +0 -0
- package/SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators/DxAutoConstructorGenerator.cs +4 -3
- package/SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators/DxMessageIdGenerator.cs +8 -6
- package/package.json +2 -1
|
Binary file
|
package/SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators/DxAutoConstructorGenerator.cs
CHANGED
|
@@ -143,7 +143,7 @@
|
|
|
143
143
|
|
|
144
144
|
foreach (TypeToGenerateInfo typeInfo in typesToGenerate)
|
|
145
145
|
{
|
|
146
|
-
if (!processedTypes.Add(typeInfo.TypeSymbol))
|
|
146
|
+
if (!processedTypes.Add(typeInfo.TypeSymbol) || typeInfo.FieldsToInject.Length == 0)
|
|
147
147
|
{
|
|
148
148
|
continue; // Already processed this type (e.g., from another partial definition)
|
|
149
149
|
}
|
|
@@ -171,13 +171,14 @@
|
|
|
171
171
|
ImmutableArray<IFieldSymbol> fieldsToInject
|
|
172
172
|
)
|
|
173
173
|
{
|
|
174
|
+
|
|
174
175
|
string namespaceName = typeSymbol.ContainingNamespace.IsGlobalNamespace
|
|
175
176
|
? string.Empty
|
|
176
177
|
: typeSymbol.ContainingNamespace.ToDisplayString();
|
|
177
178
|
string namespaceBlockOpen = string.IsNullOrEmpty(namespaceName)
|
|
178
|
-
?
|
|
179
|
+
? string.Empty
|
|
179
180
|
: $"namespace {namespaceName}\n{{";
|
|
180
|
-
|
|
181
|
+
string namespaceBlockClose = string.IsNullOrEmpty(namespaceName) ? string.Empty : "}";
|
|
181
182
|
const string indent = " ";
|
|
182
183
|
|
|
183
184
|
string typeName = typeSymbol.ToDisplayString(
|
package/SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators/DxMessageIdGenerator.cs
CHANGED
|
@@ -258,9 +258,9 @@
|
|
|
258
258
|
? string.Empty
|
|
259
259
|
: typeSymbol.ContainingNamespace.ToDisplayString();
|
|
260
260
|
string namespaceBlockOpen = string.IsNullOrEmpty(namespaceName)
|
|
261
|
-
?
|
|
261
|
+
? string.Empty
|
|
262
262
|
: $"namespace {namespaceName}\n{{";
|
|
263
|
-
|
|
263
|
+
string namespaceBlockClose = string.IsNullOrEmpty(namespaceName) ? string.Empty : "}";
|
|
264
264
|
const string indent = " ";
|
|
265
265
|
|
|
266
266
|
string typeNameWithGenerics = typeSymbol.ToDisplayString(
|
|
@@ -279,10 +279,12 @@
|
|
|
279
279
|
|
|
280
280
|
string accessibility = typeSymbol.DeclaredAccessibility switch
|
|
281
281
|
{
|
|
282
|
-
Accessibility.Public => "public
|
|
283
|
-
Accessibility.
|
|
282
|
+
Accessibility.Public => "public",
|
|
283
|
+
Accessibility.Protected => "protected",
|
|
284
|
+
Accessibility.Private => "private",
|
|
285
|
+
Accessibility.Internal => "internal",
|
|
284
286
|
// Add others if necessary, default to internal if restrictive
|
|
285
|
-
_ => "internal
|
|
287
|
+
_ => "internal",
|
|
286
288
|
};
|
|
287
289
|
|
|
288
290
|
string interfaceDeclaration = $", global::{targetInterfaceFullName}";
|
|
@@ -294,7 +296,7 @@
|
|
|
294
296
|
|
|
295
297
|
{{namespaceBlockOpen}}
|
|
296
298
|
{{indent}}// Partial implementation for {{typeNameWithGenerics}} to implement {{BaseInterfaceFullName}}
|
|
297
|
-
{{indent}}{{accessibility}}partial {{typeKind}} {{typeNameWithGenerics}} : global::{{BaseInterfaceFullName}} {{interfaceDeclaration}}
|
|
299
|
+
{{indent}}{{accessibility}} partial {{typeKind}} {{typeNameWithGenerics}} : global::{{BaseInterfaceFullName}} {{interfaceDeclaration}}
|
|
298
300
|
{{indent}}{
|
|
299
301
|
{{indent}} /// <inheritdoc/>
|
|
300
302
|
{{indent}} public global::System.Type MessageType => typeof({{fullyQualifiedName}});
|
package/package.json
CHANGED