Skip to content

Unify SerializeReference selector into [TypeSelector] with usage analyzer#50

Merged
VPDPersonal merged 5 commits into
feature/serialize-reference-dropdownfrom
refactor/unify-type-selector-attribute
Jun 11, 2026
Merged

Unify SerializeReference selector into [TypeSelector] with usage analyzer#50
VPDPersonal merged 5 commits into
feature/serialize-reference-dropdownfrom
refactor/unify-type-selector-attribute

Conversation

@VPDPersonal

Copy link
Copy Markdown
Owner

Summary

  • Remove [SerializeReferenceSelector]: [TypeSelector] now drives both field shapes — a string storing an assembly-qualified type name and a [SerializeReference] managed reference — dispatching by SerializedProperty.propertyType in TypeSelectorPropertyDrawer.
  • On a managed reference the attribute's base types narrow the candidate list below the declared field type ([TypeSelector(typeof(IMelee))] on an IWeapon field offers only IMelee implementations). Narrowing applies to concrete types and open generic definitions, in the dropdown and in the missing-type Fix picker.
  • Add the Aspid.FastTools.Analyzers git submodule (repurposed from the dormant UnityFastToolsAnalyzers repo) shipping a prebuilt Roslyn DLL with compile-time usage rules: AFT0001 (unsupported field shape, Error), AFT0002 (Allow on a managed reference, Warning), AFT0003 (base type provably disjoint with the field type, Warning). 13 xUnit tests, release tracking enabled.
  • Add build-analyzer skill and rebuild-analyzers-on-change.sh PostToolUse hook script mirroring the generator pipeline; samples, CHANGELOG and all four READMEs migrated to the merged attribute.

Notes for review

  • The analyzer submodule pin is 1ce483b (VPDPersonal/Aspid.FastTools.Analyzers, HTTPS URL). The DLL meta mirrors the generator's (RoslynAnalyzer label, all platforms excluded).
  • The hook script is committed but not yet wired into .claude/settings.json hooks.PostToolUse — adding the entry is a one-line follow-up.
  • SerializeReferenceSelectorAttribute was never released (1.0.0-rc.5 predates it), so its removal is not a breaking change for package consumers.

- Remove `[SerializeReferenceSelector]`; `[TypeSelector]` now also drives `[SerializeReference]` managed-reference fields, dispatching by property type in `TypeSelectorPropertyDrawer`.
- The attribute's base types narrow the candidate list below the declared field type — applied to both concrete types and open generic definitions, in the dropdown and the missing-type Fix picker.
- Update samples, CHANGELOG and READMEs (EN/RU) to the merged attribute.
- Add the `Aspid.FastTools.Analyzers` git submodule (VPDPersonal/Aspid.FastTools.Analyzers) carrying the `AFT*` [TypeSelector] usage rules.
- Ship the prebuilt `Aspid.FastTools.Analyzers.dll` with a `RoslynAnalyzer`-labelled meta (all platforms excluded), mirroring the generator DLL.
- Document the submodule and its manual rebuild/deploy in CLAUDE.md.
- Bump the analyzer submodule: AFT0003 now also flags a sealed class paired with an interface it does not implement; redeploy the prebuilt DLL.
- Switch the submodule URL from SSH to HTTPS so public clones resolve it without keys.
- Add the rebuild-analyzers-on-change PostToolUse hook script and the build-analyzer skill mirroring the generator pipeline; document both in CLAUDE.md.
@VPDPersonal VPDPersonal added type: refactor Internal restructuring without behavior change status: work-in-progress Draft / not ready for review dependencies Dependency or submodule update area: runtime Runtime / player code area: editor Editor-only code area: samples Sample projects area: claude Claude Code automation (.claude/ skills, agents, hooks) labels Jun 11, 2026
@VPDPersonal VPDPersonal marked this pull request as ready for review June 11, 2026 17:29
@VPDPersonal VPDPersonal merged commit 7d6e215 into feature/serialize-reference-dropdown Jun 11, 2026
3 checks passed
@github-actions github-actions Bot added status: needs-review Ready for review and removed status: work-in-progress Draft / not ready for review labels Jun 11, 2026
@VPDPersonal VPDPersonal deleted the refactor/unify-type-selector-attribute branch June 11, 2026 17:29
@github-actions github-actions Bot removed the status: needs-review Ready for review label Jun 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: claude Claude Code automation (.claude/ skills, agents, hooks) area: editor Editor-only code area: runtime Runtime / player code area: samples Sample projects dependencies Dependency or submodule update type: refactor Internal restructuring without behavior change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant