X Tutup
Skip to content

NEW: Extended action code generator to provide support for adding and removing multiple callback instances.#1593

Merged
jamesmcgill merged 11 commits intodevelopfrom
improved-code-generator-support-for-multiple-callback-instances
Nov 8, 2022
Merged

NEW: Extended action code generator to provide support for adding and removing multiple callback instances.#1593
jamesmcgill merged 11 commits intodevelopfrom
improved-code-generator-support-for-multiple-callback-instances

Conversation

@ekcoh
Copy link
Collaborator

@ekcoh ekcoh commented Oct 10, 2022

… removing multiple callback instances via generated code.

Description

Original user-contribution here from Ramobo: #889.

Changes made

Original contribution modified to preserve backwards compatible behavior for SetCallbacks and adding tests for generated code to provide code coverage.

Notes

Please write down any additional notes, remove the section if not applicable.

Checklist

Before review:

  • Changelog entry added.
    • Explains the change in Changed, Fixed, Added sections.
    • For API change contains an example snippet and/or migration example.
    • FogBugz ticket attached, example ([case %number%](https://issuetracker.unity3d.com/issues/...)).
    • FogBugz is marked as "Resolved" with next release version correctly set.
  • Tests added/changed, if applicable.
    • Functional tests Area_CanDoX, Area_CanDoX_EvenIfYIsTheCase, Area_WhenIDoX_AndYHappens_ThisIsTheResult.
    • Performance tests.
    • Integration tests.
  • Docs for new/changed API's.
    • Xmldoc cross references are set correctly.
    • Added explanation how the API works.
    • Usage code examples added.
    • The manual is updated, if needed.

During merge:

  • Commit message for squash-merge is prefixed with one of the list:
    • NEW: ___.
    • FIX: ___.
    • DOCS: ___.
    • CHANGE: ___.
    • RELEASE: 1.1.0-preview.3.

… removing multiple callback instances via generated code.
// Uninitialize existing interface.
writer.WriteLine($"if (m_Wrapper.m_{mapTypeName}CallbackInterface != null)");
writer.BeginBlock();
//writer.WriteLine($"m_Wrapper.m_{mapTypeName}CallbackInterface = instance;");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

redundant line

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this have been removed now

@ekcoh
Copy link
Collaborator Author

ekcoh commented Oct 11, 2022

@jimon @jamesmcgill Thanks for reviewing. I found that the explicit formatter of the code generator wasn't matching the the auto-formatter scripts so I updated the generator to match the auto-formatting. Hopefully this is ok now.

@ekcoh ekcoh added the feature This PR adds a feature (adds API surface), which drives minor version label Oct 24, 2022
@jamesmcgill jamesmcgill merged commit ab56f25 into develop Nov 8, 2022
@jamesmcgill jamesmcgill deleted the improved-code-generator-support-for-multiple-callback-instances branch November 8, 2022 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature This PR adds a feature (adds API surface), which drives minor version

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

X Tutup