Skip to content

Fix this.Marker() generator for explicit interfaces, generics and field naming#12

Merged
VPDPersonal merged 1 commit intomainfrom
VPDPersonal/fix-profiler-marker
Apr 30, 2026
Merged

Fix this.Marker() generator for explicit interfaces, generics and field naming#12
VPDPersonal merged 1 commit intomainfrom
VPDPersonal/fix-profiler-marker

Conversation

@VPDPersonal
Copy link
Copy Markdown
Owner

Summary

  • Strip the explicit-interface qualifier from generated marker names: IBinderAdder.Add now produces Add_Marker_Line_45 and label OneTimeBindableMember.Add (45) instead of Aspid.MVVM.IBinderAdder.Add_line_45.
  • Rename fields to the {Name}_Marker_Line_{N} convention.
  • Generate a working extension for generic types: nested Markers<T,...> holds the marker fields, the extension method is now generic with copied type constraints, and the marker label is emitted as $"TypeName<{typeof(T).Name}>.Method (line)".

Test plan

  • dotnet build of the generator project — succeeds with 0 warnings/errors.
  • Sample compilation with EmitCompilerGeneratedFiles — verified output for non-generic, generic-with-where T : class, and explicit-interface implementations matches the expected shape.
  • Open Unity editor and confirm this.Marker() keeps working in real samples (MarkerTest.cs) and in OneTimeBindableMember<T>.

…ld naming

- Use ExplicitInterfaceImplementations[0].Name to drop the interface prefix from method/property markers
- Rename marker fields to {Name}_Marker_Line_{N}
- Emit interpolated marker labels for generic types via nested Markers<T> helper, copy type constraints, make the extension method generic
@VPDPersonal VPDPersonal merged commit e4361c1 into main Apr 30, 2026
@VPDPersonal VPDPersonal deleted the VPDPersonal/fix-profiler-marker branch April 30, 2026 17:57
VPDPersonal added a commit that referenced this pull request Apr 30, 2026
…ld naming (#12)

- Use ExplicitInterfaceImplementations[0].Name to drop the interface prefix from method/property markers
- Rename marker fields to {Name}_Marker_Line_{N}
- Emit interpolated marker labels for generic types via nested Markers<T> helper, copy type constraints, make the extension method generic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant