-
Notifications
You must be signed in to change notification settings - Fork 324
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add SwiftUI Property declaration to sub section ordering list #282
Merged
Merged
Changes from 6 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
8c4393d
Add SwiftUI property declaration to sub property organization list
33ce123
Add SwiftUI property to typeorder list
26389c1
Add missing capitalized word
a35c174
Address PR comments
07f0071
Address more PR comments
6f7dcef
Format example a bit more
508b6ea
Update to SwiftFormat 0.55-beta-9, which includes relevant bug fixes
calda 5cf32e3
Merge branch 'master' into mj-swiftui-property-ordering
calda File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,7 +28,7 @@ | |
--enumthreshold 20 # organizeDeclarations | ||
--organizetypes class,struct,enum,extension,actor # organizeDeclarations | ||
--visibilityorder beforeMarks,instanceLifecycle,open,public,package,internal,fileprivate,private # organizeDeclarations | ||
--typeorder nestedType,staticProperty,staticPropertyWithBody,classPropertyWithBody,instanceProperty,instancePropertyWithBody,staticMethod,classMethod,instanceMethod # organizeDeclarations | ||
--typeorder nestedType,staticProperty,staticPropertyWithBody,classPropertyWithBody,swiftUIPropertyWrapper,instanceProperty,instancePropertyWithBody,staticMethod,classMethod,instanceMethod # organizeDeclarations | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice! |
||
--extensionacl on-declarations # extensionAccessControl | ||
--patternlet inline # hoistPatternLet | ||
--redundanttype inferred # redundantType, propertyType | ||
|
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@miguel-jimenez-0529 what do you think about generalizing this section to be any property with a property wrapper? I'm curious about the reason to scope this specifically to SwiftUI property wrappers. cc: @calda
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Me and Cal had the same conversation. Our conclusion was that there are
@
properties like@objc
that are not property wrappers. Also a property wrapper doesn't have a common semantic meaning, examples of those are@Referenced
,@UniBindable
,@Atomic
,@Resilient
. So grouping all property wrappers when we don't know upfront their functionality was a bit opinionated. Engs may have a better idea on where to place them.This is different for SwiftUI property wrappers since they all conform to the
DynamicProperty
protocol and have a common semantic meaning in the sense that they interact with the UI.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This makes sense. Thanks for explaining!