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
Only curate external non-symbols in different lang (#1269)
* Minor fixes to grammar and documentation
* Only curate external non-symbols in different lang
PR #757 enabled DocC to include manually curated non-symbol nodes in the
topics section, irrespective of the node language. This allows curating
articles across documentation in different languages, even though the
article's language is considered to be "Swift". However, the logic was
too permissive, and allowed curating non-symbol nodes within the same
bundle but across different languages. This is incorrect, since the
target page should be annotated with the `SupportedLanguage` directive
to enable curating it in a different language. A bespoke mechanism to
curate an internal reference correctly is not necessary. This patch
tightens the logic to only allow curating external references in a
different language than the source page language, and removes the
existing test for the undesired behaviour of including local references
to cross-language symbols.
The changes in PR #757 were not propagated to the navigator, resulting
in the references being present in the topics section but not in the
sidebar. This patch also introduces the curation logic in the navigator
to maintain parity with the topics section. The navigator tests for
external render nodes have been modified accordingly to reflect this
change.
rdar://155522179
@@ -364,14 +364,14 @@ public class NavigatorIndex {
364
364
Read a tree on disk from a given path.
365
365
The read is atomically performed, which means it reads all the content of the file from the disk and process the tree from loaded data.
366
366
The queue is used to load the data for a given timeout period, after that, the queue is used to schedule another read after a given delay.
367
-
This approach ensures that the used queue doesn't stall while loading the content from the disk keeping the used queue responsive.
367
+
This approach ensures that the used queue doesn't stall while loading the content from the disk keeping the used queue responsive.
368
368
369
369
- Parameters:
370
-
- timeout: The amount of time we can load a batch of items from data, once the timeout time pass,
370
+
- timeout: The duration for which we can load a batch of items from data. Once the timeout duration passes,
371
371
the reading process will reschedule asynchronously using the given queue.
372
-
- delay: The delay to wait before schedule the next read. Default: 0.01 seconds.
372
+
- delay: The duration to wait for before scheduling the next read. Default: 0.01 seconds.
373
373
- queue: The queue to use.
374
-
- broadcast: The callback to update get updates of the current process.
374
+
- broadcast: The callback to receive updates on the status of the current process.
375
375
376
376
- Note: Do not access the navigator tree root node or the map from identifier to node from a different thread than the one the queue is using while the read is performed,
377
377
this may cause data inconsistencies. For that please use the broadcast callback that notifies which items have been loaded.
@@ -455,6 +455,17 @@ extension NavigatorIndex {
455
455
self.fragment = fragment
456
456
self.languageIdentifier = languageIdentifier
457
457
}
458
+
459
+
/// Compare an identifier with another one, ignoring the identifier language.
460
+
///
461
+
/// Used when curating cross-language references in multi-language frameworks.
462
+
///
463
+
/// - Parameter other: The other identifier to compare with.
// External articles curated in the Topics section appear in all language variants. This is a workaround for https://github.com/swiftlang/swift-docc/issues/240.
305
+
// FIXME: This should ideally be solved by making the article language-agnostic rather than accomodating the "Swift" language and special-casing for non-symbols.
0 commit comments