You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a bit more public API documentation about the V2 communication protocol for external link resolver processes/executables (#1313)
* Add a bit more public API documentation about the V2 communication protocol for external link resolver processes/executables
rdar://161721734
* Add additional public API documentation about the expected `referenceURL` for successful link requests.
* Use 3 hyphens instead of em-dashes in in-source doc comments
/// Your external resolver should respond with either:
53
+
/// - a ``ResponseV2/resolved(_:)`` message, with information about the requested link.
54
+
/// - a ``ResponseV2/failure(_:)`` message, with human-readable information about the problem that the external link resolver encountered while resolving the link.
53
55
case link(String)
54
56
/// A request to resolve a symbol based on its precise identifier.
57
+
///
58
+
/// Your external resolver should respond with either:
59
+
/// - a ``ResponseV2/resolved(_:)`` message, with information about the requested symbol.
60
+
/// - an empty ``ResponseV2/failure(_:)`` message.
61
+
/// DocC doesn't display any diagnostics about failed symbol requests because they wouldn't be actionable;
62
+
/// because they're entirely automatic---based on unique identifiers in the symbol graph files---rather than authored references in the content.
55
63
case symbol(String)
56
64
57
65
// This empty-marker case is here because non-frozen enums are only available when Library Evolution is enabled,
/// A response message from the external link resolver.
99
+
/// Response messages that the external link resolver sends back to DocC for each received request..
92
100
///
93
101
/// If your external resolver sends a response that's associated with a capability that DocC hasn't declared support for, then DocC will fail to handle the response.
94
102
publicenumResponseV2:Codable{
95
-
/// The initial identifierandcapabilities message.
103
+
/// The initial identifier-and-capabilities message.
96
104
///
97
105
/// Your external link resolver should send this message, exactly once, after it has launched to signal that its ready to receive requests.
98
106
///
99
107
/// The capabilities that your external link resolver declares in this message determines which optional request messages that DocC will send.
100
108
/// If your resolver doesn't declare _any_ capabilities it only needs to handle the 3 default requests. See <doc:RequestV2#Base-requests>.
101
109
case identifierAndCapabilities(DocumentationBundle.Identifier,Capabilities)
102
-
/// The error message of the problem that the external link resolver encountered while resolving the requested topic or symbol.
110
+
/// A response with human-readable information about the problem that the external link resolver encountered while resolving the requested link or symbol.
111
+
///
112
+
/// - Note: DocC doesn't display any diagnostics about failed ``RequestV2/symbol(_:)`` requests because they wouldn't be actionable;
113
+
/// because they're entirely automatic---based on unique identifiers in the symbol graph files---rather than authored references in the content.
114
+
///
115
+
/// Your external link resolver still needs to send a response to each request but it doesn't need to include details about the failure when responding to a ``RequestV2/symbol(_:)`` request.
103
116
case failure(DiagnosticInformation)
104
-
/// A response with the resolved information about the requested topic or symbol.
117
+
/// A response with the resolved information about the requested link or symbol.
118
+
///
119
+
/// The ``LinkDestinationSummary/referenceURL`` can have a "path" and "fragment" components that are different from what DocC sent in the ``RequestV2/link(_:)`` request.
120
+
/// For example; if your resolver supports different spellings of the link---corresponding to a page's different names in different language representations---you can return the common reference URL identifier for that page for all link spellings.
121
+
///
122
+
/// - Note: DocC expects the resolved ``LinkDestinationSummary/referenceURL`` to have a "host" component that matches the ``DocumentationBundle/Identifier`` that your resolver provided in its initial ``identifierAndCapabilities(_:_:)`` handshake message.
123
+
/// Responding with a ``LinkDestinationSummary/referenceURL`` that doesn't match the resolver's provided ``DocumentationBundle/Identifier`` is undefined behavior.
105
124
case resolved(LinkDestinationSummary)
106
125
107
126
// This empty-marker case is here because non-frozen enums are only available when Library Evolution is enabled,
/// Information about why the external resolver failed to resolve the `link(_:)`, or `symbol(_:)` request.
181
+
///
182
+
/// - Note: DocC doesn't display any diagnostics about failed ``RequestV2/symbol(_:)`` requests because they wouldn't be actionable;
183
+
/// because they're entirely automatic---based on unique identifiers in the symbol graph files---rather than authored references in the content.
184
+
///
185
+
/// Your external link resolver still needs to send a response to each request but it doesn't need to include details about the failure when responding to a ``RequestV2/symbol(_:)`` request.
162
186
publicstructDiagnosticInformation:Codable{
163
187
/// A brief user-facing summary of the issue that caused the external resolver to fail.
0 commit comments