Skip to content

Commit 03af8e2

Browse files
committed
fix typos
1 parent 40f5889 commit 03af8e2

File tree

3 files changed

+24
-24
lines changed

3 files changed

+24
-24
lines changed

Sources/SwiftDocC/Infrastructure/Symbol Graph/ExtendedTypesFormatTransformation.swift

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ extension ExtendedTypesFormatTransformation {
5454
///
5555
/// The extended type symbol format provides a more concise and hierarchical structure:
5656
/// - a member symbol of the according kind for all added members
57-
/// - an **extended type symbol** _for each external type that was extended_ (and its anchestors, if the extended
57+
/// - an **extended type symbol** _for each external type that was extended_ (and its ancestors, if the extended
5858
/// type is a nested type):
5959
/// - ``SymbolKit/SymbolGraph/Symbol/KindIdentifier/extendedStruct``
60-
/// - ``SymbolKit/SymbolGraph/Symbol/KindIdentifier/extemdedClass``
60+
/// - ``SymbolKit/SymbolGraph/Symbol/KindIdentifier/extendedClass``
6161
/// - ``SymbolKit/SymbolGraph/Symbol/KindIdentifier/extendedEnum``
6262
/// - ``SymbolKit/SymbolGraph/Symbol/KindIdentifier/extendedProtocol``
6363
/// - ``SymbolKit/SymbolGraph/Symbol/KindIdentifier/unknownExtendedType``
@@ -83,7 +83,7 @@ extension ExtendedTypesFormatTransformation {
8383
/// └────────────┘ 0..1 n└─────────────┘ 1 n └────────────────┘
8484
/// ```
8585
///
86-
/// - Parameter symbolGraph: An (extension) symbol graph that should use the extensoin block symbol format.
86+
/// - Parameter symbolGraph: An (extension) symbol graph that should use the extension block symbol format.
8787
/// - Parameter moduleName: The name of the extended module all top-level symbols in this symbol graph belong to.
8888
/// - Returns: Returns whether the transformation was applied (the `symbolGraph` was an extension graph
8989
/// in the extended type symbol format) or not
@@ -117,7 +117,7 @@ extension ExtendedTypesFormatTransformation {
117117
}
118118

119119
// we sort the symbols here because their order is not guaranteed to stay the same
120-
// accross compilation processes and we always want to choose the same doc comment
120+
// across compilation processes and we always want to choose the same doc comment
121121
// in case there are multiple candidates with maximum number of lines
122122
if let winner = relevantExtensionBlockSymbols.sorted(by: \.identifier.precise).max(by: { a, b in (a.docComment?.lines.count ?? 0) < (b.docComment?.lines.count ?? 0) }) {
123123
return [winner]
@@ -138,7 +138,7 @@ extension ExtendedTypesFormatTransformation {
138138
return true
139139
}
140140

141-
/// Tries to obtain `docComment`s for all `targets` and copies the documentaiton from sources to the target.
141+
/// Tries to obtain `docComment`s for all `targets` and copies the documentation from sources to the target.
142142
///
143143
/// Iterates over all `targets` calling the `source` method to obtain a list of symbols that should serve as sources for the target's `docComment`.
144144
/// If there is more than one symbol containing a `docComment` in the compound list of target and the list returned by `source`, `onConflict` is
@@ -196,9 +196,9 @@ extension ExtendedTypesFormatTransformation {
196196

197197
/// Collects all relationships that touch any of the given extension symbols, removes them from the `symbolGraph`, and returns them separately.
198198
///
199-
/// The relevant relationships in this context are of the follwing kinds:
199+
/// The relevant relationships in this context are of the following kinds:
200200
///
201-
/// - `.extenisonTo`: the `source` must be of kind `.extension`
201+
/// - `.extensionTo`: the `source` must be of kind `.extension`
202202
/// - `.conformsTo`: the `source` may be of kind `.extension`
203203
/// - `.memberOf`: the `target` may be of kind `.extension`
204204
///
@@ -241,11 +241,11 @@ extension ExtendedTypesFormatTransformation {
241241
return (extensionToRelationships, memberOfRelationships, conformsToRelationships)
242242
}
243243

244-
/// Synthesizes extended type symbols from the given `extensionBlockSymbols` and `extensoinToRelationships`.
244+
/// Synthesizes extended type symbols from the given `extensionBlockSymbols` and `extensionToRelationships`.
245245
///
246246
/// Creates symbols of the following kinds:
247247
/// - ``SymbolKit/SymbolGraph/Symbol/KindIdentifier/extendedStruct``
248-
/// - ``SymbolKit/SymbolGraph/Symbol/KindIdentifier/extemdedClass``
248+
/// - ``SymbolKit/SymbolGraph/Symbol/KindIdentifier/extendedClass``
249249
/// - ``SymbolKit/SymbolGraph/Symbol/KindIdentifier/extendedEnum``
250250
/// - ``SymbolKit/SymbolGraph/Symbol/KindIdentifier/extendedProtocol``
251251
///
@@ -279,12 +279,12 @@ extension ExtendedTypesFormatTransformation {
279279
if let declarationFragments = extensionBlockSymbol[mixin: SymbolGraph.Symbol.DeclarationFragments.self]?.declarationFragments {
280280
var prefixWithoutWhereClause: [SymbolGraph.Symbol.DeclarationFragments.Fragment] = Array(declarationFragments[..<3])
281281

282-
outer: for fragement in declarationFragments[3...] {
283-
switch (fragement.kind, fragement.spelling) {
282+
outer: for fragment in declarationFragments[3...] {
283+
switch (fragment.kind, fragment.spelling) {
284284
case (.typeIdentifier, _),
285285
(.identifier, _),
286286
(.text, "."):
287-
prefixWithoutWhereClause.append(fragement)
287+
prefixWithoutWhereClause.append(fragment)
288288
default:
289289
break outer
290290
}
@@ -307,7 +307,7 @@ extension ExtendedTypesFormatTransformation {
307307
var extendedTypeSymbolIdentifiers: [String: String] = [:]
308308

309309
// we sort the relationships here because their order is not guaranteed to stay the same
310-
// accross compilation processes and choosing the same base symbol (and its USR) is important
310+
// across compilation processes and choosing the same base symbol (and its USR) is important
311311
// to keeping (colliding) links stable
312312
for extensionTo in extensionToRelationships.sorted(by: \.source) {
313313
guard let extensionBlockSymbol = extensionBlockSymbols[extensionTo.source] else {
@@ -332,15 +332,15 @@ extension ExtendedTypesFormatTransformation {
332332
return (extendedTypeSymbols, extensionBlockToExtendedTypeMapping, extendedTypeToExtensionBlockMapping)
333333
}
334334

335-
/// Synthesizes missing anchestor extended type symbols for any nested types among the `extendedTypeSymbols` and
335+
/// Synthesizes missing ancestor extended type symbols for any nested types among the `extendedTypeSymbols` and
336336
/// creates the relevant ``SymbolKit/SymbolGraph/Relationship/inContextOf`` relationships.
337337
///
338338
/// Creates symbols of the following kinds:
339339
/// - ``SymbolKit/SymbolGraph/Symbol/KindIdentifier/unknownExtendedType``
340340
///
341-
/// If a nested type is extended, but its parent (or another anchestor) is not, this anchestor is not part of the
341+
/// If a nested type is extended, but its parent (or another ancestor) is not, this ancestor is not part of the
342342
/// extension block symbol format. In that case, a extended type symbol of unknown kind is synthesized by
343-
/// this function. However, if the anchestor symbol is extended, the `extendedTypeSymbols` should
343+
/// this function. However, if the ancestor symbol is extended, the `extendedTypeSymbols` should
344344
/// already contain the respective symbol. In that case, the ``SymbolKit/SymbolGraph/Relationship/inContextOf``
345345
/// is attached to the existing symbol.
346346
///
@@ -444,7 +444,7 @@ extension ExtendedTypesFormatTransformation {
444444
var extendedModuleId: String?
445445

446446
// we sort the symbols here because their order is not guaranteed to stay the same
447-
// accross compilation processes and choosing the same base symbol (and its USR) is important
447+
// across compilation processes and choosing the same base symbol (and its USR) is important
448448
// to keeping (colliding) links stable
449449
for extendedTypeSymbolId in extendedTypeSymbolIds.sorted() {
450450
guard let extendedTypeSymbol = symbolGraph.symbols[extendedTypeSymbolId] else {
@@ -496,9 +496,9 @@ private extension SymbolGraph.Symbol {
496496
return new
497497
}
498498

499-
func replacing<V>(_ keyPath: WritableKeyPath<Self, V>, with closue: (Self) -> V) -> Self {
499+
func replacing<V>(_ keyPath: WritableKeyPath<Self, V>, with closure: (Self) -> V) -> Self {
500500
var new = self
501-
new[keyPath: keyPath] = closue(self)
501+
new[keyPath: keyPath] = closure(self)
502502
return new
503503
}
504504
}

Sources/SwiftDocC/Model/Rendering/DocumentationContentRenderer.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ extension DocumentationContentRenderer {
485485
/// Will strip the typeIdentifier's precise identifier.
486486
static func navigatorTitle(for tokens: [DeclarationRenderSection.Token], symbolTitle: String) -> [DeclarationRenderSection.Token] {
487487
// Replace kind "typeIdentifier" with "identifier" if the title matches the pattern:
488-
// [keyword=class,protocol,enum,typealias,etc.][ ]([typeIdentifier=anchestor(Self)][.])*[typeIdentifier=Self]
488+
// [keyword=class,protocol,enum,typealias,etc.][ ]([typeIdentifier=ancestor(Self)][.])*[typeIdentifier=Self]
489489

490490
return tokens.mapNameFragmentsToIdentifierKind(matching: symbolTitle)
491491
}
@@ -499,7 +499,7 @@ extension DocumentationContentRenderer {
499499
var tokens = tokens
500500

501501
// 1. Replace kind "typeIdentifier" with "identifier" if the title matches the pattern:
502-
// [keyword=class,protocol,enum,typealias,etc.][ ]([typeIdentifier=anchestor(Self)][.])*[typeIdentifier=Self]
502+
// [keyword=class,protocol,enum,typealias,etc.][ ]([typeIdentifier=ancestor(Self)][.])*[typeIdentifier=Self]
503503
tokens = tokens.mapNameFragmentsToIdentifierKind(matching: symbolTitle)
504504

505505

Tests/SwiftDocCTests/Infrastructure/SymbolGraph/ExtendedTypesFormatTransformationTests.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ class ExtendedTypesFormatTransformationTests: XCTestCase {
7373
}
7474
}
7575

76-
/// Tests that the transformation synthesizes anchestor extended type symbols if the extended type is a nested type
77-
/// and that these synthesized anchestors are merged with pre-existing extended type symbols where applicable.
76+
/// Tests that the transformation synthesizes ancestor extended type symbols if the extended type is a nested type
77+
/// and that these synthesized ancestors are merged with pre-existing extended type symbols where applicable.
7878
func testExtendedNestedTypeHierarchySynthesis() throws {
7979
let contents = twoExtensionBlockSymbolsExtendingSameType(extendedModule: "A", extendedType: "A", withExtensionMembers: false, pathPrefix: ["Unextended", "Extended", "UnextendedInner"])
8080
+ twoExtensionBlockSymbolsExtendingSameType(extendedModule: "A", extendedType: "Extended", withExtensionMembers: false, pathPrefix: ["Unextended"])
@@ -91,7 +91,7 @@ class ExtendedTypesFormatTransformationTests: XCTestCase {
9191

9292
let extendedTypeUnextended = try XCTUnwrap(graph.symbols.values.first(where: { symbol in symbol.kind.identifier == .unknownExtendedType && symbol.title == "Unextended" }))
9393

94-
// this anchestor is also extended so its kind should be known
94+
// this ancestor is also extended so its kind should be known
9595
let extendedTypeUnextendedDotExtended = try XCTUnwrap(graph.symbols.values.first(where: { symbol in symbol.kind.identifier == .extendedStructure && symbol.title == "Unextended.Extended" }))
9696

9797
let extendedTypeUnextendedDotExtendedDotUnextendedInner = try XCTUnwrap(graph.symbols.values.first(where: { symbol in symbol.kind.identifier == .unknownExtendedType && symbol.title == "Unextended.Extended.UnextendedInner" }))

0 commit comments

Comments
 (0)