-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
@DeprecationSummary
not having effect for some symbols (#982)
When specifying the @DeprecationSummary directive in a symbol extension markdown file, the directive wasn't taking effect if the symbol had multiple lines of documentation comments. This was happening because `DocumentationMarkup.deprecation` was only being populated in the abstract. This has now been updated to take an effect in the Discussion section as well. * Make `@DeprecationSummary` have an effect in the Discussion section * Add tests to verify `@DeprecationSummary` has effect in Discussion section * Return early when `@DeprecationSummary` is detected. When we've parsed the `@DeprecationSummary` directive, no need to continue parsing, we can exit early. * Use `XCTUnwrap` in DeprecationSummaryTests. `XCTUnwrap` is preferred over force-unwrapping or using `XCTFail` in tests. * Remove `internal` keyword. It's not needed, `internal` is the default access level. Resolves rdar://70056350.
- Loading branch information
Showing
5 changed files
with
178 additions
and
54 deletions.
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
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
13 changes: 13 additions & 0 deletions
13
...ts/Test Bundles/BundleWithLonelyDeprecationDirective.docc/CoolClass.coolFunc.md
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# ``CoolFramework/CoolClass/coolFunc()`` | ||
|
||
This is a very cool (yet deprecated) function. | ||
|
||
## Overview | ||
|
||
We can also deprecate anywhere in the discussion section. | ||
|
||
@DeprecationSummary { | ||
Use the ``CoolClass/init()`` initializer instead. | ||
} | ||
|
||
<!-- Copyright (c) 2024 Apple Inc and the Swift Project authors. All Rights Reserved. --> |
9 changes: 9 additions & 0 deletions
9
... Bundles/BundleWithLonelyDeprecationDirective.docc/CoolClass.initConfigCache.md
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# ``CoolFramework/CoolClass/init(config:cache:)`` | ||
|
||
@DeprecationSummary { | ||
This initializer is deprecated as of version 1.0.0. | ||
} | ||
|
||
Overriding the deprecation summary of a symbol that has multiple lines of documentation comments also works! | ||
|
||
<!-- Copyright (c) 2024 Apple Inc and the Swift Project authors. All Rights Reserved. --> |