Skip to content
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

Merged

Conversation

theMomax
Copy link
Contributor

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.

  • Added tests
  • Ran the ./bin/test script and it succeeded
  • Updated documentation if necessary

@theMomax
Copy link
Contributor Author

@swift-ci please test

Copy link
Contributor

@ethan-kusters ethan-kusters left a 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!


```swift
public struct Sloth { }

extension Sloth {
// This function is included in the
// documentation by default.
// This function is always included
Copy link
Contributor

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.

Suggested change
// This function is always included
// This function is always included

Copy link
Contributor Author

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
@theMomax
Copy link
Contributor Author

theMomax commented May 4, 2023

@swift-ci please test

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.

2 participants