Commit 18ba146
committed
Use the abbreviated declaration fragments in LinkDestinationSummary
LinkDestinationSummary contains a summary of an element that you can link to from outside the documentation bundle. [1]
This information is meant to be used by a server to provide information to an out-of-process resolver to resolve links to external entities, so that the partner implementation of `LinkDestinationSummary` is `OutOfProcessReferenceResolver.ResolvedInformation` [2].
However, currently `OutOfProcessReferenceResolver.ResolvedInformation. declarationFragments` is expecting the abbreviated declaration fragments, but we are storing the full fragments instead. [3]
Instead, we should be storing the abbreviated declaration fragments, which are stored as the `subHeading` of the symbol. [4] This subheading is further processed during the render node transformation phase [5], and stored as `renderNode.metadata.fragmentsVariants`.
This commit modifies `LinkDestinationSummary` such that its declaration fragments are the abbreviated declaration fragments from `renderNode.metadata.fragmentsVariants` rather than the full declaration fragments.
The final result will be that declaration fragments for external links will behave the same as local links when referencing them in the Topics section. They will both now use the abbreviated declaration fragments.
[1]: https://github.com/swiftlang/swift-docc/blob/65aaf926ec079ddbd40f29540d4180a70af99e5e/Sources/SwiftDocC/LinkTargets/LinkDestinationSummary.swift#L66
[2]: https://github.com/swiftlang/swift-docc/blob/65aaf926ec079ddbd40f29540d4180a70af99e5e/Sources/SwiftDocC/Infrastructure/External%20Data/OutOfProcessReferenceResolver.swift#L558-L562
[3]: https://github.com/swiftlang/swift-docc/blob/65aaf926ec079ddbd40f29540d4180a70af99e5e/Sources/SwiftDocC/LinkTargets/LinkDestinationSummary.swift#L445
[4]: https://github.com/swiftlang/swift-docc-symbolkit/blob/ebe89c7da4cf03ded04cd708f3399087c6f2dad7/Sources/SymbolKit/SymbolGraph/Symbol/Names.swift#L28-L311 parent 1b8e7ca commit 18ba146
File tree
4 files changed
+33
-67
lines changed- Sources/SwiftDocC/LinkTargets
- Tests/SwiftDocCTests
- LinkTargets
- Model
- Test Bundles/MixedLanguageFramework.docc/symbol-graphs/clang
4 files changed
+33
-67
lines changedLines changed: 22 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
143 | | - | |
| 143 | + | |
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
| |||
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
204 | | - | |
| 204 | + | |
205 | 205 | | |
206 | 206 | | |
207 | 207 | | |
| |||
224 | 224 | | |
225 | 225 | | |
226 | 226 | | |
227 | | - | |
| 227 | + | |
228 | 228 | | |
229 | 229 | | |
230 | 230 | | |
| |||
295 | 295 | | |
296 | 296 | | |
297 | 297 | | |
298 | | - | |
| 298 | + | |
299 | 299 | | |
300 | 300 | | |
301 | 301 | | |
| |||
483 | 483 | | |
484 | 484 | | |
485 | 485 | | |
486 | | - | |
487 | 486 | | |
488 | | - | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
489 | 496 | | |
490 | 497 | | |
491 | 498 | | |
492 | 499 | | |
493 | 500 | | |
494 | 501 | | |
495 | | - | |
496 | | - | |
497 | 502 | | |
498 | 503 | | |
499 | 504 | | |
| |||
502 | 507 | | |
503 | 508 | | |
504 | 509 | | |
| 510 | + | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
505 | 519 | | |
506 | 520 | | |
507 | 521 | | |
| |||
Lines changed: 2 additions & 17 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
296 | 296 | | |
297 | 297 | | |
298 | 298 | | |
299 | | - | |
300 | | - | |
301 | 299 | | |
302 | 300 | | |
303 | 301 | | |
| |||
530 | 528 | | |
531 | 529 | | |
532 | 530 | | |
533 | | - | |
534 | | - | |
535 | | - | |
536 | | - | |
537 | 531 | | |
538 | 532 | | |
539 | 533 | | |
| |||
551 | 545 | | |
552 | 546 | | |
553 | 547 | | |
554 | | - | |
555 | | - | |
556 | | - | |
557 | | - | |
558 | | - | |
559 | | - | |
560 | | - | |
561 | | - | |
562 | | - | |
563 | | - | |
564 | | - | |
| 548 | + | |
| 549 | + | |
565 | 550 | | |
566 | 551 | | |
567 | 552 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
556 | 556 | | |
557 | 557 | | |
558 | 558 | | |
559 | | - | |
| 559 | + | |
560 | 560 | | |
561 | 561 | | |
562 | 562 | | |
| |||
Lines changed: 8 additions & 41 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
366 | 366 | | |
367 | 367 | | |
368 | 368 | | |
369 | | - | |
370 | | - | |
371 | | - | |
372 | | - | |
373 | 369 | | |
374 | 370 | | |
375 | | - | |
376 | | - | |
377 | | - | |
378 | | - | |
379 | | - | |
380 | | - | |
381 | | - | |
382 | | - | |
383 | | - | |
| 371 | + | |
384 | 372 | | |
385 | 373 | | |
386 | 374 | | |
387 | | - | |
388 | | - | |
389 | | - | |
390 | | - | |
391 | | - | |
392 | | - | |
393 | | - | |
394 | | - | |
395 | | - | |
396 | | - | |
397 | | - | |
398 | | - | |
399 | | - | |
400 | | - | |
401 | | - | |
402 | | - | |
403 | | - | |
404 | | - | |
405 | | - | |
406 | | - | |
407 | | - | |
408 | | - | |
| 375 | + | |
409 | 376 | | |
410 | 377 | | |
411 | 378 | | |
| |||
485 | 452 | | |
486 | 453 | | |
487 | 454 | | |
488 | | - | |
| 455 | + | |
489 | 456 | | |
490 | 457 | | |
491 | 458 | | |
| |||
570 | 537 | | |
571 | 538 | | |
572 | 539 | | |
573 | | - | |
| 540 | + | |
574 | 541 | | |
575 | 542 | | |
576 | 543 | | |
| |||
630 | 597 | | |
631 | 598 | | |
632 | 599 | | |
633 | | - | |
| 600 | + | |
634 | 601 | | |
635 | 602 | | |
636 | 603 | | |
| |||
677 | 644 | | |
678 | 645 | | |
679 | 646 | | |
680 | | - | |
| 647 | + | |
681 | 648 | | |
682 | 649 | | |
683 | 650 | | |
| |||
724 | 691 | | |
725 | 692 | | |
726 | 693 | | |
727 | | - | |
| 694 | + | |
728 | 695 | | |
729 | 696 | | |
730 | 697 | | |
| |||
771 | 738 | | |
772 | 739 | | |
773 | 740 | | |
774 | | - | |
| 741 | + | |
775 | 742 | | |
776 | 743 | | |
777 | 744 | | |
| |||
0 commit comments