forked from swiftlang/swift-docc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[external-links] Display frameworks as beta only if all platforms are…
… beta (swiftlang#938) * Display frameworks as beta only if all platforms are beta Changes the behaviour of external link resolution in `OutOfProcessReferenceResolver` to only display a framework to be in beta if all the platforms its supported in are in beta. This makes it match the behaviour for internal link resolution, so that the behaviour is consistent whether you're linking to a symbol internally within a framework or externally from another framework. * Refactor code to have same behaviour in both external link resolvers Makes changes to `OutOfProcessReferenceResolver .ResolvedInformation` so that it can be replaced by `LinkDestinationSummary` at some point in the future. Both `OutOfProcessReferenceResolver .ResolvedInformation` and `LinkDestinationSummary` now contain information about whether the resolved external link points to a symbol in beta or not, using equivalent API. This is an attempt at keeping both of the logics about whether an external symbol is in beta in sync with each other. Hopefully in the future we can unify and have the same code path for both, but right now the logic is duplicated (and equal). * Add a test for beta logic in ExternalPathHierarchyResolver Adds a unit test which verifies that the logic for determining whether a symbol is in beta when using `ExternalPathHierarchyResolver` is as expected. * Fix formatting Test file `OutOfProcessReferenceResolverTests` had inconsistent and confusing formatting, particularly with how the type of `makeResolver` was being defined across multiple lines in a way inconsistent with the rest of the codebase. `makeResolver` is now declared as a one-liner and fixes other minor formatting/spacing issues. * Remove noop Info.plist The file isn't needed, so removing it. * Remove changes to testBundleAndContext helpers We want to avoid spreading the configure context parameter to the other test helpers, as we're slowly working to make the context not be configured after creation. Instead, `ExternalPathHierarchyResolverTests` now calls the underlying `loadBundle(from:configureContext:)` directly. --- Resolves rdar://128997995.
- Loading branch information
Showing
5 changed files
with
462 additions
and
13 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
241 changes: 241 additions & 0 deletions
241
Tests/SwiftDocCTests/Test Bundles/AvailabilityBetaBundle.docc/mykit.symbols.json
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,241 @@ | ||
{ | ||
"metadata": { | ||
"formatVersion" : { | ||
"major" : 1 | ||
}, | ||
"generator" : "app/1.0" | ||
}, | ||
"module" : { | ||
"name" : "MyKit", | ||
"platform" : { | ||
"architecture" : "x86_64", | ||
"vendor" : "apple", | ||
"operatingSystem" : { | ||
"name" : "macosx", | ||
"minimumVersion" : { | ||
"major" : 1, | ||
"minor" : 0, | ||
"patch" : 0 | ||
} | ||
} | ||
} | ||
}, | ||
"symbols" : [ | ||
{ | ||
"accessLevel" : "public", | ||
"kind" : { | ||
"identifier" : "swift.class", | ||
"displayName" : "Class" | ||
}, | ||
"names" : { | ||
"title" : "MyClass", | ||
"subHeading" : [ | ||
{ | ||
"kind" : "keyword", | ||
"spelling" : "class" | ||
}, | ||
{ | ||
"kind" : "text", | ||
"spelling" : " " | ||
}, | ||
{ | ||
"kind" : "identifier", | ||
"spelling" : "MyClass" | ||
} | ||
], | ||
"navigator" : [ | ||
{ | ||
"kind" : "identifier", | ||
"spelling" : "MyClassNavigator" | ||
} | ||
] | ||
}, | ||
"availability" : [ | ||
{ | ||
"domain": "macOS", | ||
"introduced": { | ||
"major": 1, | ||
"minor": 0 | ||
} | ||
}, | ||
{ | ||
"domain": "watchOS", | ||
"introduced": { | ||
"major": 2, | ||
"minor": 0 | ||
} | ||
}, | ||
{ | ||
"domain": "tvOS", | ||
"introduced": { | ||
"major": 3, | ||
"minor": 0 | ||
} | ||
}, | ||
{ | ||
"domain": "iOS", | ||
"introduced": { | ||
"major": 4, | ||
"minor": 0 | ||
} | ||
} | ||
], | ||
"pathComponents" : [ | ||
"MyClass" | ||
], | ||
"identifier" : { | ||
"precise" : "s:5MyKit0A5ClassC", | ||
"interfaceLanguage": "swift" | ||
}, | ||
"declarationFragments" : [ | ||
{ | ||
"kind" : "keyword", | ||
"spelling" : "class" | ||
}, | ||
{ | ||
"kind" : "text", | ||
"spelling" : " " | ||
}, | ||
{ | ||
"kind" : "identifier", | ||
"spelling" : "MyClass" | ||
} | ||
] | ||
}, | ||
{ | ||
"accessLevel" : "public", | ||
"kind" : { | ||
"identifier" : "swift.class", | ||
"displayName" : "Class" | ||
}, | ||
"names" : { | ||
"title" : "MyOtherClass", | ||
"subHeading" : [ | ||
{ | ||
"kind" : "keyword", | ||
"spelling" : "class" | ||
}, | ||
{ | ||
"kind" : "text", | ||
"spelling" : " " | ||
}, | ||
{ | ||
"kind" : "identifier", | ||
"spelling" : "MyOtherClass" | ||
} | ||
], | ||
"navigator" : [ | ||
{ | ||
"kind" : "identifier", | ||
"spelling" : "MyOtherClassNavigator" | ||
} | ||
] | ||
}, | ||
"availability" : [ | ||
{ | ||
"domain": "macOS", | ||
"introduced": { | ||
"major": 1, | ||
"minor": 0 | ||
} | ||
}, | ||
{ | ||
"domain": "watchOS", | ||
"introduced": { | ||
"major": 2, | ||
"minor": 0 | ||
} | ||
}, | ||
{ | ||
"domain": "tvOS", | ||
"introduced": { | ||
"major": 3, | ||
"minor": 0 | ||
} | ||
}, | ||
{ | ||
"domain": "iOS", | ||
"introduced": { | ||
"major": 3, | ||
"minor": 0 | ||
} | ||
} | ||
], | ||
"pathComponents" : [ | ||
"MyOtherClass" | ||
], | ||
"identifier" : { | ||
"precise" : "s:5MyKit0A5MyOtherClassC", | ||
"interfaceLanguage": "swift" | ||
}, | ||
"declarationFragments" : [ | ||
{ | ||
"kind" : "keyword", | ||
"spelling" : "class" | ||
}, | ||
{ | ||
"kind" : "text", | ||
"spelling" : " " | ||
}, | ||
{ | ||
"kind" : "identifier", | ||
"spelling" : "MyOtherClass" | ||
} | ||
] | ||
}, | ||
{ | ||
"accessLevel" : "public", | ||
"kind" : { | ||
"identifier" : "swift.class", | ||
"displayName" : "Class" | ||
}, | ||
"names" : { | ||
"title" : "MyThirdClass", | ||
"subHeading" : [ | ||
{ | ||
"kind" : "keyword", | ||
"spelling" : "class" | ||
}, | ||
{ | ||
"kind" : "text", | ||
"spelling" : " " | ||
}, | ||
{ | ||
"kind" : "identifier", | ||
"spelling" : "MyThirdClass" | ||
} | ||
], | ||
"navigator" : [ | ||
{ | ||
"kind" : "identifier", | ||
"spelling" : "MyThirdClassNavigator" | ||
} | ||
] | ||
}, | ||
"availability" : [], | ||
"pathComponents" : [ | ||
"MyThirdClass" | ||
], | ||
"identifier" : { | ||
"precise" : "s:5MyKit0A5MyThirdClassC", | ||
"interfaceLanguage": "swift" | ||
}, | ||
"declarationFragments" : [ | ||
{ | ||
"kind" : "keyword", | ||
"spelling" : "class" | ||
}, | ||
{ | ||
"kind" : "text", | ||
"spelling" : " " | ||
}, | ||
{ | ||
"kind" : "identifier", | ||
"spelling" : "MyThirdClass" | ||
} | ||
] | ||
}, | ||
|
||
], | ||
"relationships" : [] | ||
} |
Oops, something went wrong.