com.wallstop-studios.dxmessaging 2.1.9 → 3.0.1

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.
Files changed (249) hide show
  1. package/CHANGELOG.md +106 -65
  2. package/CHANGELOG.md.meta +7 -7
  3. package/Editor/Analyzers/BaseCallIlInspector.cs +277 -0
  4. package/Editor/Analyzers/BaseCallIlInspector.cs.meta +11 -0
  5. package/Editor/Analyzers/BaseCallLogMessageParser.cs +295 -0
  6. package/Editor/Analyzers/BaseCallLogMessageParser.cs.meta +11 -0
  7. package/Editor/Analyzers/BaseCallReportAggregator.cs +308 -0
  8. package/Editor/Analyzers/BaseCallReportAggregator.cs.meta +11 -0
  9. package/Editor/Analyzers/BaseCallTypeScanner.cs +110 -0
  10. package/Editor/Analyzers/BaseCallTypeScanner.cs.meta +11 -0
  11. package/Editor/Analyzers/BaseCallTypeScannerCore.cs +562 -0
  12. package/Editor/Analyzers/BaseCallTypeScannerCore.cs.meta +11 -0
  13. package/Editor/Analyzers/DxMessagingConsoleHarvester.cs +1122 -0
  14. package/Editor/Analyzers/DxMessagingConsoleHarvester.cs.meta +11 -0
  15. package/Editor/Analyzers/Microsoft.CodeAnalysis.CSharp.dll.meta +44 -44
  16. package/Editor/Analyzers/Microsoft.CodeAnalysis.dll.meta +44 -44
  17. package/Editor/Analyzers/System.Collections.Immutable.dll.meta +44 -44
  18. package/Editor/Analyzers/System.Reflection.Metadata.dll.meta +44 -44
  19. package/Editor/Analyzers/System.Runtime.CompilerServices.Unsafe.dll.meta +44 -44
  20. package/Editor/Analyzers/WallstopStudios.DxMessaging.Analyzer.dll +0 -0
  21. package/Editor/Analyzers/WallstopStudios.DxMessaging.Analyzer.dll.meta +33 -0
  22. package/Editor/Analyzers/WallstopStudios.DxMessaging.SourceGenerators.dll +0 -0
  23. package/Editor/Analyzers/WallstopStudios.DxMessaging.SourceGenerators.dll.meta +72 -72
  24. package/Editor/Analyzers.meta +8 -8
  25. package/Editor/AssemblyInfo.cs.meta +3 -3
  26. package/Editor/CustomEditors/MessageAwareComponentFallbackEditor.cs +81 -0
  27. package/Editor/CustomEditors/MessageAwareComponentFallbackEditor.cs.meta +11 -0
  28. package/Editor/CustomEditors/MessageAwareComponentInspectorOverlay.cs +420 -0
  29. package/Editor/CustomEditors/MessageAwareComponentInspectorOverlay.cs.meta +11 -0
  30. package/Editor/CustomEditors/MessagingComponentEditor.cs +1 -1
  31. package/Editor/CustomEditors/MessagingComponentEditor.cs.meta +2 -2
  32. package/Editor/CustomEditors.meta +2 -2
  33. package/Editor/DxMessagingEditorInitializer.cs +1 -1
  34. package/Editor/DxMessagingEditorInitializer.cs.meta +2 -2
  35. package/Editor/DxMessagingMenu.cs.meta +11 -11
  36. package/Editor/DxMessagingSceneBuildProcessor.cs.meta +11 -11
  37. package/Editor/Settings/DxMessagingBaseCallIgnoreSync.cs +190 -0
  38. package/Editor/Settings/DxMessagingBaseCallIgnoreSync.cs.meta +11 -0
  39. package/Editor/Settings/DxMessagingSettings.cs +189 -0
  40. package/Editor/Settings/DxMessagingSettings.cs.meta +2 -2
  41. package/Editor/Settings/DxMessagingSettingsProvider.cs +50 -33
  42. package/Editor/Settings/DxMessagingSettingsProvider.cs.meta +2 -2
  43. package/Editor/Settings.meta +2 -2
  44. package/Editor/SetupCscRsp.cs +209 -8
  45. package/Editor/SetupCscRsp.cs.meta +2 -2
  46. package/Editor/Testing/MessagingComponentEditorHarness.cs +1 -1
  47. package/Editor/Testing/MessagingComponentEditorHarness.cs.meta +3 -3
  48. package/Editor/Testing.meta +3 -3
  49. package/Editor/WallstopStudios.DxMessaging.Editor.asmdef +14 -14
  50. package/Editor/WallstopStudios.DxMessaging.Editor.asmdef.meta +7 -7
  51. package/Editor.meta +8 -8
  52. package/LICENSE.md +9 -9
  53. package/LICENSE.md.meta +7 -7
  54. package/README.md +941 -900
  55. package/README.md.meta +7 -7
  56. package/Runtime/AssemblyInfo.cs +4 -0
  57. package/Runtime/AssemblyInfo.cs.meta +2 -2
  58. package/Runtime/Core/Attributes/DxAutoConstructorAttribute.cs.meta +2 -2
  59. package/Runtime/Core/Attributes/DxBroadcastMessageAttribute.cs.meta +2 -2
  60. package/Runtime/Core/Attributes/DxIgnoreMissingBaseCallAttribute.cs +26 -0
  61. package/Runtime/Core/Attributes/DxIgnoreMissingBaseCallAttribute.cs.meta +11 -0
  62. package/Runtime/Core/Attributes/DxOptionalParameterAttribute.cs.meta +2 -2
  63. package/Runtime/Core/Attributes/DxTargetedMessageAttribute.cs.meta +2 -2
  64. package/Runtime/Core/Attributes/DxUntargetedMessageAttribute.cs.meta +2 -2
  65. package/Runtime/Core/Attributes.meta +2 -2
  66. package/Runtime/Core/Configuration/DxMessagingRuntimeSettings.cs +195 -0
  67. package/Runtime/Core/Configuration/DxMessagingRuntimeSettings.cs.meta +11 -0
  68. package/Runtime/Core/Configuration/DxMessagingRuntimeSettingsProvider.cs +179 -0
  69. package/Runtime/Core/Configuration/DxMessagingRuntimeSettingsProvider.cs.meta +11 -0
  70. package/Runtime/Core/Configuration.meta +9 -0
  71. package/Runtime/Core/DataStructure/CyclicBuffer.cs +2 -2
  72. package/Runtime/Core/DataStructure/CyclicBuffer.cs.meta +2 -2
  73. package/Runtime/Core/DataStructure.meta +2 -2
  74. package/Runtime/Core/Diagnostics/MessageEmissionData.cs.meta +2 -2
  75. package/Runtime/Core/Diagnostics/MessageRegistrationData.cs.meta +2 -2
  76. package/Runtime/Core/Diagnostics/MessageRegistrationType.cs.meta +2 -2
  77. package/Runtime/Core/Diagnostics.meta +2 -2
  78. package/Runtime/Core/DxMessagingStaticState.cs +19 -0
  79. package/Runtime/Core/DxMessagingStaticState.cs.meta +11 -11
  80. package/Runtime/Core/Extensions/EnumExtensions.cs.meta +2 -2
  81. package/Runtime/Core/Extensions/IListExtensions.cs.meta +2 -2
  82. package/Runtime/Core/Extensions/MessageBusExtensions.cs.meta +12 -12
  83. package/Runtime/Core/Extensions/MessageExtensions.cs.meta +11 -11
  84. package/Runtime/Core/Extensions.meta +8 -8
  85. package/Runtime/Core/Helper/MessageCache.cs +32 -0
  86. package/Runtime/Core/Helper/MessageCache.cs.meta +2 -2
  87. package/Runtime/Core/Helper/MessageHelperIndexer.cs.meta +2 -2
  88. package/Runtime/Core/Helper.meta +2 -2
  89. package/Runtime/Core/IMessage.cs +3 -3
  90. package/Runtime/Core/IMessage.cs.meta +11 -11
  91. package/Runtime/Core/InstanceId.cs.meta +11 -11
  92. package/Runtime/Core/Internal/TypedDispatchLinkIndex.cs +51 -0
  93. package/Runtime/Core/Internal/TypedDispatchLinkIndex.cs.meta +11 -0
  94. package/Runtime/Core/Internal/TypedGlobalSlotIndex.cs +38 -0
  95. package/Runtime/Core/Internal/TypedGlobalSlotIndex.cs.meta +11 -0
  96. package/Runtime/Core/Internal/TypedSlotIndex.cs +81 -0
  97. package/Runtime/Core/Internal/TypedSlotIndex.cs.meta +11 -0
  98. package/Runtime/Core/Internal/TypedSlots.cs +613 -0
  99. package/Runtime/Core/Internal/TypedSlots.cs.meta +11 -0
  100. package/Runtime/Core/Internal.meta +9 -0
  101. package/Runtime/Core/MessageBus/DiagnosticsTarget.cs.meta +11 -11
  102. package/Runtime/Core/MessageBus/GlobalMessageBusProvider.cs.meta +11 -11
  103. package/Runtime/Core/MessageBus/IMessageBus.cs +177 -3
  104. package/Runtime/Core/MessageBus/IMessageBus.cs.meta +11 -11
  105. package/Runtime/Core/MessageBus/IMessageBusProvider.cs.meta +11 -11
  106. package/Runtime/Core/MessageBus/IMessageRegistrationBuilder.cs.meta +11 -11
  107. package/Runtime/Core/MessageBus/Internal/BusContextIndex.cs +16 -0
  108. package/Runtime/Core/MessageBus/Internal/BusContextIndex.cs.meta +11 -0
  109. package/Runtime/Core/MessageBus/Internal/BusSinkIndex.cs +40 -0
  110. package/Runtime/Core/MessageBus/Internal/BusSinkIndex.cs.meta +11 -0
  111. package/Runtime/Core/MessageBus/Internal/BusSlots.cs +718 -0
  112. package/Runtime/Core/MessageBus/Internal/BusSlots.cs.meta +11 -0
  113. package/Runtime/Core/MessageBus/Internal/DispatchKind.cs +38 -0
  114. package/Runtime/Core/MessageBus/Internal/DispatchKind.cs.meta +11 -0
  115. package/Runtime/Core/MessageBus/Internal/DispatchPhase.cs +20 -0
  116. package/Runtime/Core/MessageBus/Internal/DispatchPhase.cs.meta +11 -0
  117. package/Runtime/Core/MessageBus/Internal/DispatchVariant.cs +28 -0
  118. package/Runtime/Core/MessageBus/Internal/DispatchVariant.cs.meta +11 -0
  119. package/Runtime/Core/MessageBus/Internal/IEvictableSlot.cs +48 -0
  120. package/Runtime/Core/MessageBus/Internal/IEvictableSlot.cs.meta +11 -0
  121. package/Runtime/Core/MessageBus/Internal/ISweepable.cs +15 -0
  122. package/Runtime/Core/MessageBus/Internal/ISweepable.cs.meta +11 -0
  123. package/Runtime/Core/MessageBus/Internal/RegistrationMethodAxes.cs +222 -0
  124. package/Runtime/Core/MessageBus/Internal/RegistrationMethodAxes.cs.meta +11 -0
  125. package/Runtime/Core/MessageBus/Internal/SlotKey.cs +192 -0
  126. package/Runtime/Core/MessageBus/Internal/SlotKey.cs.meta +11 -0
  127. package/Runtime/Core/MessageBus/Internal.meta +9 -0
  128. package/Runtime/Core/MessageBus/MessageBus.cs +2651 -500
  129. package/Runtime/Core/MessageBus/MessageBus.cs.meta +11 -11
  130. package/Runtime/Core/MessageBus/MessageBusRebindMode.cs.meta +11 -11
  131. package/Runtime/Core/MessageBus/MessageRegistrationBuilder.cs.meta +11 -11
  132. package/Runtime/Core/MessageBus/MessagingRegistration.cs.meta +11 -11
  133. package/Runtime/Core/MessageBus/RegistrationLog.cs.meta +11 -11
  134. package/Runtime/Core/MessageBus.meta +8 -8
  135. package/Runtime/Core/MessageHandler.cs +2019 -542
  136. package/Runtime/Core/MessageHandler.cs.meta +11 -11
  137. package/Runtime/Core/MessageRegistrationHandle.cs.meta +11 -11
  138. package/Runtime/Core/MessageRegistrationToken.cs +7 -0
  139. package/Runtime/Core/MessageRegistrationToken.cs.meta +11 -11
  140. package/Runtime/Core/Messages/GlobalStringMessage.cs.meta +2 -2
  141. package/Runtime/Core/Messages/IBroadcastMessage.cs.meta +11 -11
  142. package/Runtime/Core/Messages/ITargetedMessage.cs.meta +11 -11
  143. package/Runtime/Core/Messages/IUntargetedMessage.cs.meta +11 -11
  144. package/Runtime/Core/Messages/ReflexiveMessage.cs.meta +2 -2
  145. package/Runtime/Core/Messages/SourcedStringMessage.cs.meta +11 -11
  146. package/Runtime/Core/Messages/StringMessage.cs.meta +2 -2
  147. package/Runtime/Core/Messages.meta +8 -8
  148. package/Runtime/Core/MessagingDebug.cs.meta +11 -11
  149. package/Runtime/Core/Pooling/CollectionPool.cs +266 -0
  150. package/Runtime/Core/Pooling/CollectionPool.cs.meta +11 -0
  151. package/Runtime/Core/Pooling/CollectionPoolDiagnostics.cs +30 -0
  152. package/Runtime/Core/Pooling/CollectionPoolDiagnostics.cs.meta +11 -0
  153. package/Runtime/Core/Pooling/DxPools.cs +157 -0
  154. package/Runtime/Core/Pooling/DxPools.cs.meta +11 -0
  155. package/Runtime/Core/Pooling/EvictionPlayerLoopHook.cs +106 -0
  156. package/Runtime/Core/Pooling/EvictionPlayerLoopHook.cs.meta +11 -0
  157. package/Runtime/Core/Pooling/IDxMessagingClock.cs +18 -0
  158. package/Runtime/Core/Pooling/IDxMessagingClock.cs.meta +11 -0
  159. package/Runtime/Core/Pooling/PoolDiagnosticsSnapshot.cs +55 -0
  160. package/Runtime/Core/Pooling/PoolDiagnosticsSnapshot.cs.meta +11 -0
  161. package/Runtime/Core/Pooling/StopwatchClock.cs +27 -0
  162. package/Runtime/Core/Pooling/StopwatchClock.cs.meta +11 -0
  163. package/Runtime/Core/Pooling/UnityRealtimeClock.cs +31 -0
  164. package/Runtime/Core/Pooling/UnityRealtimeClock.cs.meta +11 -0
  165. package/Runtime/Core/Pooling.meta +9 -0
  166. package/Runtime/Core.meta +8 -8
  167. package/Runtime/Unity/CurrentGlobalMessageBusProvider.cs.meta +12 -12
  168. package/Runtime/Unity/DxMessagingRuntimeInitializer.cs.meta +11 -11
  169. package/Runtime/Unity/InitialGlobalMessageBusProvider.cs.meta +12 -12
  170. package/Runtime/Unity/Integrations/Reflex/AssemblyInfo.cs.meta +2 -2
  171. package/Runtime/Unity/Integrations/Reflex/ReflexRegistrationInstaller.cs +73 -0
  172. package/Runtime/Unity/Integrations/Reflex/ReflexRegistrationInstaller.cs.meta +11 -11
  173. package/Runtime/Unity/Integrations/Reflex/WallstopStudios.DxMessaging.Reflex.asmdef +20 -20
  174. package/Runtime/Unity/Integrations/Reflex/WallstopStudios.DxMessaging.Reflex.asmdef.meta +7 -7
  175. package/Runtime/Unity/Integrations/Reflex.meta +8 -8
  176. package/Runtime/Unity/Integrations/VContainer/AssemblyInfo.cs.meta +2 -2
  177. package/Runtime/Unity/Integrations/VContainer/VContainerRegistrationExtensions.cs +109 -1
  178. package/Runtime/Unity/Integrations/VContainer/VContainerRegistrationExtensions.cs.meta +11 -11
  179. package/Runtime/Unity/Integrations/VContainer/WallstopStudios.DxMessaging.VContainer.asmdef +30 -30
  180. package/Runtime/Unity/Integrations/VContainer/WallstopStudios.DxMessaging.VContainer.asmdef.meta +7 -7
  181. package/Runtime/Unity/Integrations/VContainer.meta +8 -8
  182. package/Runtime/Unity/Integrations/Zenject/AssemblyInfo.cs.meta +2 -2
  183. package/Runtime/Unity/Integrations/Zenject/WallstopStudios.DxMessaging.Zenject.asmdef +30 -30
  184. package/Runtime/Unity/Integrations/Zenject/WallstopStudios.DxMessaging.Zenject.asmdef.meta +7 -7
  185. package/Runtime/Unity/Integrations/Zenject/ZenjectRegistrationInstaller.cs +79 -1
  186. package/Runtime/Unity/Integrations/Zenject/ZenjectRegistrationInstaller.cs.meta +11 -11
  187. package/Runtime/Unity/Integrations/Zenject.meta +8 -8
  188. package/Runtime/Unity/Integrations.meta +8 -8
  189. package/Runtime/Unity/MessageAwareComponent.cs +29 -0
  190. package/Runtime/Unity/MessageAwareComponent.cs.meta +11 -11
  191. package/Runtime/Unity/MessageBusProviderHandle.cs.meta +12 -12
  192. package/Runtime/Unity/MessagingComponent.cs.meta +11 -11
  193. package/Runtime/Unity/MessagingComponentInstaller.cs.meta +12 -12
  194. package/Runtime/Unity/ScriptableMessageBusProvider.cs.meta +12 -12
  195. package/Runtime/Unity.meta +8 -8
  196. package/Runtime/WallstopStudios.DxMessaging.asmdef +14 -14
  197. package/Runtime/WallstopStudios.DxMessaging.asmdef.meta +7 -7
  198. package/Runtime.meta +8 -8
  199. package/Samples~/DI/Prefabs/MessagingInstallerSample.prefab +98 -98
  200. package/Samples~/DI/Prefabs/MessagingInstallerSample.prefab.meta +7 -7
  201. package/Samples~/DI/Prefabs.meta +8 -8
  202. package/Samples~/DI/Providers/GlobalMessageBusProvider.asset +14 -14
  203. package/Samples~/DI/Providers/GlobalMessageBusProvider.asset.meta +8 -8
  204. package/Samples~/DI/Providers/InitialGlobalMessageBusProvider.asset +14 -14
  205. package/Samples~/DI/Providers/InitialGlobalMessageBusProvider.asset.meta +8 -8
  206. package/Samples~/DI/Providers.meta +8 -8
  207. package/Samples~/DI/README.md +51 -51
  208. package/Samples~/DI/README.md.meta +7 -7
  209. package/Samples~/DI/Reflex/SampleInstaller.cs +7 -0
  210. package/Samples~/DI/Reflex/SampleInstaller.cs.meta +11 -11
  211. package/Samples~/DI/Reflex.meta +8 -8
  212. package/Samples~/DI/VContainer/SampleLifetimeScope.cs +6 -1
  213. package/Samples~/DI/VContainer/SampleLifetimeScope.cs.meta +11 -11
  214. package/Samples~/DI/VContainer.meta +8 -8
  215. package/Samples~/DI/Zenject/SampleInstaller.cs +8 -0
  216. package/Samples~/DI/Zenject/SampleInstaller.cs.meta +11 -11
  217. package/Samples~/DI/Zenject.meta +8 -8
  218. package/Samples~/DI.meta +8 -8
  219. package/Samples~/Mini Combat/Boot.cs.meta +11 -11
  220. package/Samples~/Mini Combat/Enemy.cs.meta +11 -11
  221. package/Samples~/Mini Combat/Messages.cs.meta +11 -11
  222. package/Samples~/Mini Combat/Player.cs.meta +11 -11
  223. package/Samples~/Mini Combat/README.md +324 -323
  224. package/Samples~/Mini Combat/README.md.meta +7 -7
  225. package/Samples~/Mini Combat/UIOverlay.cs.meta +11 -11
  226. package/Samples~/Mini Combat/Walkthrough.md +430 -430
  227. package/Samples~/Mini Combat/Walkthrough.md.meta +7 -7
  228. package/Samples~/Mini Combat/WallstopStudios.DxMessaging.MiniCombat.Sample.asmdef +13 -13
  229. package/Samples~/Mini Combat/WallstopStudios.DxMessaging.MiniCombat.Sample.asmdef.meta +7 -7
  230. package/Samples~/Mini Combat.meta +8 -8
  231. package/Samples~/UI Buttons + Inspector/DiagnosticsEnabler.cs.meta +11 -11
  232. package/Samples~/UI Buttons + Inspector/Messages.cs.meta +11 -11
  233. package/Samples~/UI Buttons + Inspector/MessagingObserver.cs.meta +11 -11
  234. package/Samples~/UI Buttons + Inspector/README.md +210 -209
  235. package/Samples~/UI Buttons + Inspector/README.md.meta +7 -7
  236. package/Samples~/UI Buttons + Inspector/UIButtonEmitter.cs.meta +11 -11
  237. package/Samples~/UI Buttons + Inspector/WallstopStudios.DxMessaging.UIButtons.Sample.asmdef +13 -13
  238. package/Samples~/UI Buttons + Inspector/WallstopStudios.DxMessaging.UIButtons.Sample.asmdef.meta +7 -7
  239. package/Samples~/UI Buttons + Inspector.meta +8 -8
  240. package/SourceGenerators/Directory.Build.props.meta +7 -7
  241. package/SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators/DxAutoConstructorGenerator.cs.meta +11 -11
  242. package/SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators/DxMessageIdGenerator.cs.meta +2 -2
  243. package/SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators.csproj.meta +7 -7
  244. package/SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators.meta +8 -8
  245. package/SourceGenerators.meta +8 -8
  246. package/Third Party Notices.md +3 -3
  247. package/Third Party Notices.md.meta +7 -7
  248. package/package.json +115 -92
  249. package/package.json.meta +7 -7
@@ -0,0 +1,110 @@
1
+ namespace DxMessaging.Editor.Analyzers
2
+ {
3
+ #if UNITY_EDITOR
4
+ using System;
5
+ using System.Collections.Generic;
6
+ using DxMessaging.Editor.Settings;
7
+ using DxMessaging.Unity;
8
+ using UnityEditor;
9
+
10
+ /// <summary>
11
+ /// Edit-time scanner that walks loaded <see cref="MessageAwareComponent"/> subclasses via
12
+ /// <see cref="TypeCache"/> and forwards them to the pure (Unity-API-free) classification
13
+ /// helper <see cref="BaseCallTypeScannerCore"/>. Replaces the lossy console-scraping bridge
14
+ /// as the inspector overlay's primary data source.
15
+ /// </summary>
16
+ /// <remarks>
17
+ /// <para>
18
+ /// <b>Why IL reflection?</b> Unity's <c>CompilationPipeline.assemblyCompilationFinished</c> and
19
+ /// the <c>LogEntries</c> console store are both downstream of Unity's decision to actually
20
+ /// surface analyzer warnings. On Bee/csc cache hits -- which happen on most domain reloads
21
+ /// after the first -- Unity skips that surface entirely, so the scrape returns nothing even
22
+ /// though the analyzer ran successfully on the first compile. By contrast, IL reflection over
23
+ /// loaded types is deterministic: the assemblies are in the AppDomain, the methods have IL
24
+ /// bodies, the same scan produces the same result on every reload regardless of whether the
25
+ /// build was a fresh compile or a Bee cache hit.
26
+ /// </para>
27
+ /// <para>
28
+ /// <b>What it detects:</b>
29
+ /// <list type="bullet">
30
+ /// <item><description>DXMSG006 -- overrides one of the five guarded methods but the IL body
31
+ /// lacks a <c>call</c>/<c>callvirt</c> to the parent's same-named method.</description></item>
32
+ /// <item><description>DXMSG007 -- declares the method with the <c>new</c> modifier (IL: name
33
+ /// shadows a base virtual but the descendant method itself is not in an override slot).</description></item>
34
+ /// <item><description>DXMSG009 -- declares the method without override or new -- same IL shape
35
+ /// as DXMSG007 (both compile to a non-virtual hide-by-sig method). The scanner cannot
36
+ /// distinguish the two perfectly from IL alone, so it conservatively classifies this case as
37
+ /// DXMSG007. The compile-time analyzer is authoritative for the precise ID classification;
38
+ /// the scanner's job is just to make sure the inspector overlay lights up.</description></item>
39
+ /// <item><description>DXMSG010 -- overrides correctly (calls base) but an intermediate
40
+ /// ancestor's override in the chain does NOT call base. Walks parent-by-parent and re-runs the
41
+ /// IL check at every link until the chain terminates at <see cref="MessageAwareComponent"/>
42
+ /// or hits a broken link.</description></item>
43
+ /// </list>
44
+ /// </para>
45
+ /// <para>
46
+ /// <b>Cross-assembly assume-clean:</b> ancestors whose IL is unavailable
47
+ /// (<see cref="System.Reflection.MethodBase.GetMethodBody"/> returns null -- e.g., abstract or
48
+ /// extern methods) are trusted. Emitting an unactionable warning against a closed-source
49
+ /// third-party library would be hostile.
50
+ /// </para>
51
+ /// <para>
52
+ /// <b>Implementation split:</b> the Unity-coupled work (<see cref="TypeCache"/> lookup,
53
+ /// <see cref="DxMessagingSettings"/> read, conversion to the Unity-serializable
54
+ /// <see cref="BaseCallReportEntry"/>) lives here; everything else (chain walk, IL probe,
55
+ /// FQN normalisation, opt-out handling) lives in <see cref="BaseCallTypeScannerCore"/> so the
56
+ /// dotnet-test project can cover the classification logic via Roslyn-compiled fixtures.
57
+ /// </para>
58
+ /// </remarks>
59
+ internal static class BaseCallTypeScanner
60
+ {
61
+ /// <summary>
62
+ /// Scan all loaded <see cref="MessageAwareComponent"/> subclasses and return a per-type
63
+ /// report keyed by fully-qualified type name. The report shape matches what the
64
+ /// console-bridge produced, so the inspector overlay code path needs no changes.
65
+ /// </summary>
66
+ /// <remarks>
67
+ /// Types opted out via <c>[DxIgnoreMissingBaseCall]</c> or via the project's ignored-types
68
+ /// list are intentionally NOT included in the returned dictionary -- the overlay reads the
69
+ /// project ignore list directly to render its "Stop ignoring" HelpBox, and the snapshot
70
+ /// semantics here match the bridge path (DXMSG008-equivalent rows were never present in
71
+ /// the snapshot's <c>missingBaseFor</c> either).
72
+ /// </remarks>
73
+ internal static Dictionary<string, BaseCallReportEntry> Scan(DxMessagingSettings settings)
74
+ {
75
+ // TypeCache is Unity's domain-reload-cached type lookup. Effectively O(1) after the
76
+ // first call and survives across reloads via Unity's serialization layer. Using
77
+ // TypeCache (rather than scanning every loaded assembly via AppDomain) is important
78
+ // for performance; a fresh project can have hundreds of assemblies loaded.
79
+ TypeCache.TypeCollection candidates =
80
+ TypeCache.GetTypesDerivedFrom<MessageAwareComponent>();
81
+
82
+ // Defensive: TypeCache.GetTypesDerivedFrom<T>() returns strict subclasses, but
83
+ // belt-and-braces in case a future Unity version changes the contract; we feed the
84
+ // list through Core.Scan which itself skips MessageAwareComponent by FQN match.
85
+ // The Core handles abstract / generic-definition / null-FQN skipping uniformly.
86
+ Dictionary<string, BaseCallTypeScannerCore.ScanEntry> coreResult =
87
+ BaseCallTypeScannerCore.Scan(
88
+ candidates,
89
+ settings != null ? settings._baseCallIgnoredTypes : null
90
+ );
91
+
92
+ Dictionary<string, BaseCallReportEntry> result = new(StringComparer.Ordinal);
93
+ foreach (KeyValuePair<string, BaseCallTypeScannerCore.ScanEntry> kvp in coreResult)
94
+ {
95
+ BaseCallTypeScannerCore.ScanEntry core = kvp.Value;
96
+ BaseCallReportEntry entry = new()
97
+ {
98
+ typeName = core.TypeName,
99
+ missingBaseFor = new List<string>(core.MissingBaseFor),
100
+ diagnosticIds = new List<string>(core.DiagnosticIds),
101
+ filePath = string.Empty,
102
+ line = 0,
103
+ };
104
+ result[kvp.Key] = entry;
105
+ }
106
+ return result;
107
+ }
108
+ }
109
+ #endif
110
+ }
@@ -0,0 +1,11 @@
1
+ fileFormatVersion: 2
2
+ guid: 58c96078f9224e208d973216c43884a9
3
+ MonoImporter:
4
+ externalObjects: {}
5
+ serializedVersion: 2
6
+ defaultReferences: []
7
+ executionOrder: 0
8
+ icon: {instanceID: 0}
9
+ userData:
10
+ assetBundleName:
11
+ assetBundleVariant: