docs(di): trim cycle-internal codes and verbose block comments
Code comments were drifting into plan-internal shorthand (DI-2a, Slice B, "see plan §9") that nobody outside the cycle authors can decode. They also tended toward AI-generated paragraph blocks where a two-line WHY would have done. This commit tightens the comment surface from the v1.5.0 work: - IPluginLogProxy header lists the consumer buckets without naming the cycle items that decided them. - DalamudLogger / DalamudLoggingProvider provenance markers explain themselves in two lines each; the long EUPL-rationale paragraph moves to the commit message. - PluginHostFactory block headers shrink to one line each, ASCII dividers come out, plan-internal codes go. - Plugin.cs field doc and Phase-1 / DisposeAsync comments lose the cycle-name references; the file gains nothing from "C3 surfaced X" in code. - FontManager / GameFunctions static-method notes shrink to one sentence each. - InitHostedServices class header keeps the eager-resolve WHY in three lines, drops the constraint label. Csharpier reformatted the .csproj layout (long PackageReference multi-lined). No functional change, no behavior change.
This commit is contained in:
+10
-20
@@ -125,9 +125,8 @@ public sealed class Plugin : IAsyncDalamudPlugin
|
||||
// isolation. Wired immediately after Dalamud injects Log.
|
||||
internal static IPluginLogProxy LogProxy { get; private set; } = null!;
|
||||
|
||||
// Container drives the v1.5.0 bootstrap. Both are nullable so DisposeAsync
|
||||
// stays safe if Phase-1 (Host build) throws before they get assigned -
|
||||
// Dalamud fires DisposeAsync regardless of how far the ctor got.
|
||||
// Nullable so DisposeAsync stays safe if Host-build throws before the
|
||||
// fields get assigned — Dalamud fires DisposeAsync regardless.
|
||||
private readonly IHost? _host;
|
||||
private readonly PluginLifecycle? _lifecycle;
|
||||
|
||||
@@ -222,17 +221,14 @@ public sealed class Plugin : IAsyncDalamudPlugin
|
||||
DeferredSaveFrames = -1;
|
||||
|
||||
// Custom themes dir + seed run before the container builds so the
|
||||
// ThemeRegistry factory lambda finds the directory ready and the
|
||||
// example theme stays in place if the user has not touched it.
|
||||
// ThemeRegistry factory lambda finds the directory ready.
|
||||
var customThemesDir = Path.Combine(Interface.ConfigDirectory.FullName, "themes");
|
||||
Directory.CreateDirectory(customThemesDir);
|
||||
SeedExampleThemeIfEmpty(customThemesDir);
|
||||
|
||||
// Phase-1: build the generic host and pull singletons out into the
|
||||
// Plugin.X surface so consumers untouched by DI-2a keep working. The
|
||||
// host stays sync here because the schema gate above must run before
|
||||
// services allocate; deferring the build to LoadAsync (Lightless'
|
||||
// pattern) would mean the gate fires after the container is alive.
|
||||
// Phase-1: build the host synchronously (the schema gate must clear
|
||||
// before services allocate; Lightless' deferred build would invert
|
||||
// that order) and pull singletons into the Plugin.X surface.
|
||||
var dependencies = new PluginHostDependencies(
|
||||
Interface,
|
||||
Log,
|
||||
@@ -527,10 +523,7 @@ public sealed class Plugin : IAsyncDalamudPlugin
|
||||
}
|
||||
);
|
||||
|
||||
// Framework-thread cleanup the container does not reach. TearDownCommands
|
||||
// walks Plugin-private dictionaries; SetChatInteractable is a static
|
||||
// call into game state; WindowSystem.RemoveAllWindows clears the
|
||||
// backing List<> that AddWindow populated in PluginLifecycle.LoadAsync.
|
||||
// Framework-thread cleanup the container does not reach.
|
||||
try
|
||||
{
|
||||
await Framework
|
||||
@@ -550,12 +543,9 @@ public sealed class Plugin : IAsyncDalamudPlugin
|
||||
failure ??= ex;
|
||||
}
|
||||
|
||||
// Lifecycle stops the host (HostedService.StopAsync) and disposes the
|
||||
// container on the framework thread; that path disposes all the
|
||||
// services + windows we used to dispose manually here. The smoke from
|
||||
// C3 surfaced MessageManager.DisposeAsync as non-idempotent (CTS
|
||||
// dispose at line 99 throws on a second call), so we hand the entire
|
||||
// service teardown to the container instead of double-disposing.
|
||||
// Container disposes services + windows on the framework thread.
|
||||
// MessageManager.DisposeAsync is not idempotent, so we let the
|
||||
// container do it once instead of double-disposing.
|
||||
if (_lifecycle is not null)
|
||||
{
|
||||
failure = await CaptureFailureAsync(failure, () => _lifecycle.DisposeAsync().AsTask())
|
||||
|
||||
Reference in New Issue
Block a user