Add Unity specific code cleanup rules #1676
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds a Unity specific code cleanup pattern that reorders file members in the same way as the Default profile, but does not reorder serialised fields. Event functions are grouped before other methods, and sorted so that commonly used/more important functions (such as
Update
) are listed first. Less commonly used event functions are sorted after, in alphabetical order.The patterns can be edited and saved to settings, with buttons to populate default, default with regions and empty patterns. The existing file layout settings are not compatible with merging data from a plugin (and "un-merging" if the plugin is disabled/uninstalled), so the Unity patterns are edited and saved separately. A new options page has been added:: Preferences | Languages & Frameworks | Unity Engine | Additional File Layout.