Skip to content
This repository was archived by the owner on Jun 1, 2023. It is now read-only.

Commit e88d5a4

Browse files
keanmattt
authored andcommitted
Save symbols in HomePage
1 parent 7705c4f commit e88d5a4

File tree

1 file changed

+18
-13
lines changed

1 file changed

+18
-13
lines changed

Sources/swift-doc/Supporting Types/Pages/HomePage.swift

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ struct HomePage: Page {
1010
var enumerations: [Symbol] = []
1111
var structures: [Symbol] = []
1212
var protocols: [Symbol] = []
13-
var operatorNames: Set<String> = []
14-
var globalTypealiasNames: Set<String> = []
15-
var globalFunctionNames: Set<String> = []
16-
var globalVariableNames: Set<String> = []
13+
var operators: [Symbol] = []
14+
var globalTypealias: [Symbol] = []
15+
var globalFunctions: [Symbol] = []
16+
var globalVariables: [Symbol] = []
1717

1818
init(module: Module) {
1919
self.module = module
@@ -28,16 +28,16 @@ struct HomePage: Page {
2828
structures.append(symbol)
2929
case is Protocol:
3030
protocols.append(symbol)
31-
case let `typealias` as Typealias:
32-
globalTypealiasNames.insert(`typealias`.name)
33-
case let `operator` as Operator:
34-
operatorNames.insert(`operator`.name)
31+
case is Typealias:
32+
globalTypealias.append(symbol)
33+
case is Operator:
34+
operators.append(symbol)
3535
case let function as Function where function.isOperator:
36-
operatorNames.insert(function.name)
37-
case let function as Function:
38-
globalFunctionNames.insert(function.name)
39-
case let variable as Variable:
40-
globalVariableNames.insert(variable.name)
36+
operators.append(symbol)
37+
case is Function:
38+
globalFunctions.append(symbol)
39+
case is Variable:
40+
globalVariables.append(symbol)
4141
default:
4242
continue
4343
}
@@ -54,6 +54,11 @@ struct HomePage: Page {
5454
let types = classes + enumerations + structures
5555
let typeNames = Set(types.map { $0.id.description })
5656
let protocolNames = Set(protocols.map { $0.id.description })
57+
let operatorNames = Set(operators.map { $0.id.description })
58+
59+
let globalTypealiasNames = Set(globalTypealias.map { $0.id.description })
60+
let globalFunctionNames = Set(globalFunctions.map { $0.id.description })
61+
let globalVariableNames = Set(globalVariables.map { $0.id.description })
5762

5863
return Document {
5964
ForEach(in: [

0 commit comments

Comments
 (0)