File tree Expand file tree Collapse file tree 2 files changed +25
-5
lines changed
Sources/SymbolGraphCompiler Expand file tree Collapse file tree 2 files changed +25
-5
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,13 @@ extension SSGC
24
24
}
25
25
}
26
26
extension SSGC . Extensions
27
+ {
28
+ var all : Dictionary < SSGC . ExtensionSignature , SSGC . ExtensionObject > . Values
29
+ {
30
+ self . groups. values
31
+ }
32
+ }
33
+ extension SSGC . Extensions
27
34
{
28
35
mutating
29
36
func include( _ vertex: SymbolGraphPart . Vertex ,
@@ -114,7 +121,7 @@ extension SSGC.Extensions
114
121
/// Gather extension members attributable to the specified culture, simplifying the
115
122
/// extension signatures by inspecting the extended declaration. This may coalesce
116
123
/// multiple extension objects into a single extension layer.
117
- let coalesced : [ SSGC . Extension . ID : SSGC . ExtensionLayer ] = try self . groups . values . reduce (
124
+ let coalesced : [ SSGC . Extension . ID : SSGC . ExtensionLayer ] = try self . all . reduce (
118
125
into: [ : ] )
119
126
{
120
127
let blocks : [ ( id: Symbol . Block , block: SSGC . Extension . Block ) ] = $1. blocks. reduce (
Original file line number Diff line number Diff line change @@ -525,16 +525,29 @@ extension SSGC.TypeChecker
525
525
""" )
526
526
}
527
527
}
528
-
529
- self . resolvableLinks [ heir. namespace, heir. value. path, feature. value. path. last] . append (
530
- . feature( feature. value, self : heir. id) )
531
528
}
532
529
}
533
530
extension SSGC . TypeChecker
534
531
{
535
- public __consuming
532
+ public consuming
536
533
func load( in culture: Symbol . Module ) throws -> SSGC . ModuleIndex
537
534
{
535
+ for `extension` : SSGC . ExtensionObject in self . extensions. all
536
+ {
537
+ // We add the feature paths here and not in `insert(_:by:)` because those
538
+ // edges are frequently duplicated, and it is hard to remove duplicate paths
539
+ // after they have been added.
540
+ let extendee : SSGC . DeclObject = try self . declarations [ `extension`. extendee]
541
+ for feature : Symbol . Decl in `extension`. features. keys
542
+ {
543
+ let feature : SSGC . Decl = try self . declarations [ feature] . value
544
+ let last : String = feature. path. last
545
+
546
+ self . resolvableLinks [ extendee. namespace, extendee. value. path, last] . append (
547
+ . feature( feature, self : extendee. id) )
548
+ }
549
+ }
550
+
538
551
let extensions : [ SSGC . Extension ] = try self . extensions. load ( culture: culture,
539
552
with: self . declarations)
540
553
You can’t perform that action at this time.
0 commit comments