-
Notifications
You must be signed in to change notification settings - Fork 53
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
Make --include-extended-types default for Swift 5.9 #57
Make --include-extended-types default for Swift 5.9 #57
Conversation
…xclude-extended-types flag
@swift-ci please test |
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.
Looks great – thank you!
...tDocCPluginDocumentation/SwiftDocCPlugin.docc/Generating Documentation for Extended Types.md
Outdated
Show resolved
Hide resolved
|
||
```swift | ||
public struct Sloth { } | ||
|
||
extension Sloth { | ||
// This function is included in the | ||
// documentation by default. | ||
// This function is always included |
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.
Nit: Technically this is a method and not a function: https://docs.swift.org/swift-book/documentation/the-swift-programming-language/methods/.
Functions in Swift are defined at the top-level.
// This function is always included | |
// This function is always included |
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.
Well, as it says in the first sentence: Methods are functions that are associated with a particular type. Not every function is a method, but every method is a function. But I'm happy to change it anyways :)
- mention default behavior earlier in docs - be more precise about method/function terminology in docs
@swift-ci please test |
Bug/issue #, if applicable: swiftlang/swift-docc#210
Summary
This PR makes
--include-extended-types
the default behavior for handling extended types when compiled with a Swift version greater or equal to 5.9. It also introduces the negative counterpart flag--exclude-extended-types
, which is available from Swift 5.8. The default behavior for Swift 5.8 remains unchanged (equivalent to--exclude-extended-types
).The DocC documentation for the Plugin has been reworded.
The relevant part of the help text generated by the plugin's help flag has been reworded and shown both flags (
--include-extended-types
and--exclude-extended-types
) along with the default value. The text is the same for Swift 5.8 and Swift 5.9, except for the default value.Dependencies
None.
Testing
There are unit and integration tests making sure the behavior and help text is as expected for the Swift version the tests are run with. I ran the full
bin/test
suite with a Swift 5.7, Swift 5.8, and Swift 5.9 toolchain each and tested invocations manually with the same toolchains on a local test target.Checklist
Make sure you check off the following items. If they cannot be completed, provide a reason.
./bin/test
script and it succeeded