Use AutoInject Analyzers for Godot node scripts
mainAutoInject Analyzers are Roslyn analyzers that provide diagnostics and code fixes for common issues when using Chickensoft.AutoInject within Godot node scripts. They help ensure that dependency injection patterns are correctly implemented and that required lifecycle methods are called.
Supported diagnostics and fixes include:
- Missing override of
void _Notification(int what): Ensures the node correctly overrides the notification method required for the injection lifecycle. - Missing call to
this.Notify(): Ensures that nodes correctly trigger notifications to update dependencies. - Missing call to
this.Provide()for nodes implementingIProvider: Ensures that nodes providing dependencies correctly callProvide()to register them in the injection tree.