Skip to content

Commit 98a0af5

Browse files
patshaughnessyKyle-Yejoey-gm
authored
Documentation - Typos & Consistency Fixes (#716) (#721)
Co-authored-by: Kyle <[email protected]> Co-authored-by: Joey GM <[email protected]>
1 parent 3ffa8e4 commit 98a0af5

File tree

70 files changed

+103
-100
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+103
-100
lines changed

Sources/SwiftDocC/Benchmark/Metrics/TopicAnchorHash.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
import Foundation
1212

1313
extension Benchmark {
14-
/// A anchor sections hash metric produced off the given documentation context.
14+
/// An anchor sections hash metric produced off the given documentation context.
1515
///
1616
/// Use this metric to verify that your code changes
1717
/// did not affect the anchor sections in the compiled documentation.

Sources/SwiftDocC/Checker/Checkers/NonInclusiveLanguageChecker.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ public struct NonInclusiveLanguageChecker: Checker {
121121

122122
/// Checks for a term in text.
123123
///
124-
/// The regular expression created from the provided term is evaluated with the case insensitve flag.
124+
/// The regular expression created from the provided term is evaluated with the case insensitive flag.
125125
///
126126
/// - Parameters:
127127
/// - term: The term to look for.

Sources/SwiftDocC/Indexing/Navigator/NavigatorIndex.swift

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ public class NavigatorIndex {
6363
public enum Error: Swift.Error, DescribedError {
6464

6565
/// Missing bundle identifier.
66+
case missingBundleIdentifier
67+
68+
@available(*, deprecated, renamed: "missingBundleIdentifier")
6669
case missingBundleIndentifier
6770

6871
/// A RenderNode has no title and won't be indexed.
@@ -72,8 +75,8 @@ public class NavigatorIndex {
7275
case navigatorIndexIsNil
7376

7477
public var errorDescription: String {
75-
switch self {
76-
case .missingBundleIndentifier:
78+
switch self {
79+
case .missingBundleIdentifier, .missingBundleIndentifier:
7780
return "A navigator index requires a bundle identifier, which is missing."
7881
case .missingTitle:
7982
return "The page has no valid title available."
@@ -175,7 +178,7 @@ public class NavigatorIndex {
175178
let bundleIdentifier = bundleIdentifier ?? information.get(type: String.self, forKey: NavigatorIndex.bundleKey) ?? NavigatorIndex.UnknownBundleIdentifier
176179

177180
guard bundleIdentifier != NavigatorIndex.UnknownBundleIdentifier else {
178-
throw Error.missingBundleIndentifier
181+
throw Error.missingBundleIdentifier
179182
}
180183

181184
// Use `.fnv1` by default if no path hasher is set for compatibility reasons.
@@ -237,7 +240,7 @@ public class NavigatorIndex {
237240
- url: The URL pointing to the path from which the index should be read.
238241
- bundleIdentifier: The name of the bundle the index is referring to.
239242
- readNavigatorTree: Indicates if the init needs to read the navigator tree from the disk, if false, then `readNavigatorTree` needs to be called later. Default: `true`.
240-
- presentationIdentifier: Indicates if the index has an indentifier useful for presentation contexts.
243+
- presentationIdentifier: Indicates if the index has an identifier useful for presentation contexts.
241244

242245
- Throws: A `NavigatorIndex.Error` describing the nature of the problem.
243246

@@ -282,7 +285,7 @@ public class NavigatorIndex {
282285
self.availabilityIndex = AvailabilityIndex()
283286

284287
guard self.bundleIdentifier != NavigatorIndex.UnknownBundleIdentifier else {
285-
throw Error.missingBundleIndentifier
288+
throw Error.missingBundleIdentifier
286289
}
287290
}
288291

@@ -577,10 +580,10 @@ extension NavigatorIndex {
577580
/// A temporary list of pending references that are waiting for their parent to be indexed.
578581
private var pendingUncuratedReferences = Set<Identifier>()
579582

580-
/// A map with all nodes that are curated mutliple times in the tree and need to be processed at the very end.
583+
/// A map with all nodes that are curated multiple times in the tree and need to be processed at the very end.
581584
private var multiCurated = [Identifier: NavigatorTree.Node]()
582585

583-
/// A set with all nodes that are curated mutliple times, but still have to be visited.
586+
/// A set with all nodes that are curated multiple times, but still have to be visited.
584587
private var multiCuratedUnvisited = Set<Identifier>()
585588

586589
/// A set with all nodes that are curated.
@@ -747,7 +750,7 @@ extension NavigatorIndex {
747750
}
748751
}
749752

750-
// Sort the IDs so multiple entries with the same availiabilities
753+
// Sort the IDs so multiple entries with the same availabilities
751754
// will generate the same hash. In this way we can find them in the dictionary.
752755
entryIDs.sort()
753756

Sources/SwiftDocC/Indexing/Navigator/NavigatorTree.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public protocol Serializable: LMDBData, RawRepresentable where RawValue == Data
3131

3232
The object needs to be conforming to `Serializable` so it can be transformed to raw data and reconstructed back using the same one.
3333

34-
- Note: The `parentID` might be missing if the object is the root, but to avoid creating an exception on the the object structure, its id is set to 0.
34+
- Note: The `parentID` might be missing if the object is the root, but to avoid creating an exception on the object structure, its id is set to 0.
3535
*/
3636
public class NavigatorTree {
3737

@@ -225,7 +225,7 @@ public class NavigatorTree {
225225
queue.append(root)
226226

227227
var index: UInt32 = 0
228-
while index < queue.count {
228+
while index < queue.count {
229229
let node = queue[Int(index)]
230230
node.id = index
231231
numericIdentifierToNode[index] = node

Sources/SwiftDocC/Indexing/RenderNode+Relationships.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ extension RenderNode {
2222

2323
switch kind {
2424
case .overview:
25-
for case let section as VolumeRenderSection in sections {
25+
for case let section as VolumeRenderSection in sections {
2626
let chapters = section.chapters
2727
for chapter in chapters {
2828
let name = chapter.name
@@ -67,7 +67,7 @@ extension RenderNode {
6767
*/
6868
public func projectFiles() -> DownloadReference? {
6969
// sampleDownload is provided by pages which are of type "sample code".
70-
// This section provides an action which includes a download referece.
70+
// This section provides an action which includes a download reference.
7171
if let sampleDownload = sampleDownload, case let RenderInlineContent.reference(identifier, _, _, _) = sampleDownload.action,
7272
let reference = references[identifier.identifier] {
7373
return reference as? DownloadReference

Sources/SwiftDocC/Infrastructure/Bundle Assets/DataAssetManager.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ struct DataAssetManager {
2929
var fuzzyKeyIndex = [String: String]()
3030

3131
/**
32-
Returns the data that is registered to an data asset with the specified trait collection.
32+
Returns the data that is registered to a data asset with the specified trait collection.
3333

3434
If no data is registered that exactly matches the trait collection, the data with the trait
3535
collection that best matches the requested trait collection is returned.

Sources/SwiftDocC/Infrastructure/Communication/Foundation/JSON.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ extension JSON {
7777

7878
subscript(key: Any) -> JSON? {
7979
get {
80-
if let array = self.array, let index = key as? Int, index < array.count {
80+
if let array = self.array, let index = key as? Int, index < array.count {
8181
return array[index]
8282
} else if let dic = self.dictionary, let key = key as? String, let obj = dic[key] {
8383
return obj

Sources/SwiftDocC/Infrastructure/CoverageDataEntry.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ extension CoverageDataEntry {
318318
context: context))
319319
case .structure, .extendedStructure:
320320
self = try .structure(
321-
memberStats: KindSpecificData.extractChildStats(
321+
memberStats: KindSpecificData.extractChildStats(
322322
documentationNode: documentationNode,
323323
context: context))
324324
case .protocol, .extendedProtocol:
@@ -464,7 +464,7 @@ extension CoverageDataEntry.KindSpecificData {
464464

465465
/// For cases that have an associated type `RatioStatistic`, the appropriate initializer for that case on `KindSpecificData`
466466
/// - Throws: If the instance does not represent a case with associated type `RatioStatistic`
467-
/// - Returns: An closure that accepts an instance of `RatioStatistic` and returns an instance of `KindSpecificData`
467+
/// - Returns: A closure that accepts an instance of `RatioStatistic` and returns an instance of `KindSpecificData`
468468
func associatedRatioStatisticInitializer() throws -> (RatioStatistic) -> CoverageDataEntry
469469
.KindSpecificData
470470
{
@@ -500,7 +500,7 @@ extension CoverageDataEntry.KindSpecificData {
500500

501501
/// For cases that have an associated type `[InstanceMemberType: RatioStatistic]`, the appropriate initializer for that case on `KindSpecificData`
502502
/// - Throws: If the instance does not represent a case with associated type `RatioStatistic`
503-
/// - Returns: An closure that accepts an instance of `[InstanceMemberType: RatioStatistic]` and returns an instance of `KindSpecificData`
503+
/// - Returns: A closure that accepts an instance of `[InstanceMemberType: RatioStatistic]` and returns an instance of `KindSpecificData`
504504
func associatedMemberStatisticsInitializer() throws -> ([InstanceMemberType: RatioStatistic]) -> CoverageDataEntry
505505
.KindSpecificData
506506
{

Sources/SwiftDocC/Infrastructure/Diagnostics/Diagnostic.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public struct Diagnostic {
4242
return summary
4343
}
4444

45-
/// Additional details that explain the the problem or issue to the end-user in plain language.
45+
/// Additional details that explain the problem or issue to the end-user in plain language.
4646
public var explanation: String?
4747

4848
@available(*, deprecated, renamed: "explanation")

Sources/SwiftDocC/Infrastructure/DocumentationContext.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ public class DocumentationContext: DocumentationContextDataProviderDelegate {
258258

259259
/// The mapping of external symbol identifiers to known disambiguated symbol path components.
260260
///
261-
/// In situations where the the local documentation context doesn't contain all of the current module's
261+
/// In situations where the local documentation context doesn't contain all of the current module's
262262
/// symbols, for example when using a ``ConvertService`` with a partial symbol graph,
263263
/// the documentation context is otherwise unable to accurately detect a collision for a given symbol and correctly
264264
/// disambiguate its path components. This value can be used to inject already disambiguated symbol
@@ -435,7 +435,7 @@ public class DocumentationContext: DocumentationContextDataProviderDelegate {
435435
/// - Parameter moduleReference: The module reference to find the module name for.
436436
/// - Returns: The plain string name for the referenced module.
437437
func moduleName(forModuleReference moduleReference: ResolvedTopicReference) -> (displayName: String, symbolName: String) {
438-
if let name = moduleNameCache[moduleReference] {
438+
if let name = moduleNameCache[moduleReference] {
439439
return name
440440
}
441441
// If no name is found it's considered a programmer error; either that the names haven't been resolved yet
@@ -2543,7 +2543,7 @@ public class DocumentationContext: DocumentationContextDataProviderDelegate {
25432543

25442544
// MARK: - Relationship queries
25452545

2546-
/// Fetch the child nodes of a documentation node with the given `reference``, optionally filtering to only children of the given `kind`.
2546+
/// Fetch the child nodes of a documentation node with the given `reference`, optionally filtering to only children of the given `kind`.
25472547
///
25482548
/// - Parameters:
25492549
/// - reference: The reference of the node to fetch children for.
@@ -2669,7 +2669,7 @@ public class DocumentationContext: DocumentationContextDataProviderDelegate {
26692669
/// - Parameters:
26702670
/// - name: The name of the asset.
26712671
/// - parent: The topic where the asset is referenced.
2672-
/// - Returns: The data that's associated with a image asset if it was found, otherwise `nil`.
2672+
/// - Returns: The data that's associated with an image asset if it was found, otherwise `nil`.
26732673
public func resolveAsset(named name: String, in parent: ResolvedTopicReference, withType type: AssetType? = nil) -> DataAsset? {
26742674
let bundleIdentifier = parent.bundleIdentifier
26752675
return resolveAsset(named: name, bundleIdentifier: bundleIdentifier, withType: type)

Sources/SwiftDocC/Infrastructure/External Data/ExternalSymbolResolver.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import Foundation
1717
/// * Resolve authored symbol references and return the precise identifier for the resolved symbol.
1818
/// * Return an external URL for the references that it was able to resolve.
1919
///
20-
/// If a symbol in a symbol graph file references a type that's not in the local bundle — for a example, the symbol conforms to a protocol that's not defined in the local bundle, the
20+
/// If a symbol in a symbol graph file references a type that's not in the local bundle — for example, the symbol conforms to a protocol that's not defined in the local bundle, the
2121
/// symbol inherits from a class that's not defined in the local bundle, or the symbol has arguments or return values that are types which are not defined in the local bundle —
2222
/// then this external resolver can resolve those symbol references. This allows references in symbol declarations to be turned into links for external references, just like in-bundle
2323
/// symbol references can be.

Sources/SwiftDocC/Infrastructure/External Data/FallbackReferenceResolver.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
import Foundation
1212

13-
/// An reference resolver that can be used to resolve references that couldn't be resolved locally.
13+
/// A reference resolver that can be used to resolve references that couldn't be resolved locally.
1414
///
1515
/// Fallback reference resolvers are used by a ``DocumentationContext`` to resolve externally resolve references that
1616
/// couldn't be resolved internally.

Sources/SwiftDocC/Infrastructure/Link Resolution/PathHierarchy.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ struct PathHierarchy {
5151

5252
// MARK: Creating a path hierarchy
5353

54-
/// Initializes a path hierarchy with the all the symbols from all modules that a the given symbol graph loader provides.
54+
/// Initializes a path hierarchy with all the symbols from all modules that the given symbol graph loader provides.
5555
///
5656
/// - Parameters:
5757
/// - loader: The symbol graph loader that provides all symbols.

Sources/SwiftDocC/Infrastructure/Link Resolution/PathHierarchyBasedLinkResolver.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ final class PathHierarchyBasedLinkResolver {
161161
addAnchors(anchorSections, to: articleID)
162162
}
163163

164-
/// Adds a article and its headings to the path hierarchy.
164+
/// Adds an article and its headings to the path hierarchy.
165165
func addArticle(filename: String, reference: ResolvedTopicReference, anchorSections: [AnchorSection]) {
166166
let articleID = pathHierarchy.addArticle(name: filename)
167167
resolvedReferenceMap[articleID] = reference

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ extension SymbolGraph.Relationship.Kind {
1717
/// respective extended module symbol.
1818
static let declaredIn = Self(rawValue: "declaredIn")
1919

20-
/// This relationship markes a parent-child hierarchy between a nested
20+
/// This relationship marks a parent-child hierarchy between a nested
2121
/// extended type symbol and its parent extended type symbol. It mirrors the
2222
/// `memberOf` relationship between the two respective original type symbols.
2323
static let inContextOf = Self(rawValue: "inContextOf")

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ extension ExtendedTypeFormatTransformation {
202202
}
203203

204204
for source in source(target) {
205-
if case (.some(_), .some(_)) = (target.docComment, source.docComment) {
205+
if case (.some(_), .some(_)) = (target.docComment, source.docComment) {
206206
target.docComment = resolveConflict(target, source)
207207
} else {
208208
target.docComment = target.docComment ?? source.docComment
@@ -314,7 +314,7 @@ extension ExtendedTypeFormatTransformation {
314314

315315
extensionBlockToExtendedTypeMapping.reserveCapacity(extensionBlockSymbols.count)
316316

317-
let createExtendedTypeSymbolAndAnchestors = { (extensionBlockSymbol: SymbolGraph.Symbol, id: String) -> SymbolGraph.Symbol in
317+
let createExtendedTypeSymbolAndAncestors = { (extensionBlockSymbol: SymbolGraph.Symbol, id: String) -> SymbolGraph.Symbol in
318318
var newMixins = [String: Mixin]()
319319

320320
if var swiftExtension = extensionBlockSymbol[mixin: SymbolGraph.Symbol.Swift.Extension.self] {
@@ -365,7 +365,7 @@ extension ExtendedTypeFormatTransformation {
365365

366366
let symbol: SymbolGraph.Symbol = extendedTypeSymbols[extendedSymbolId]?.replacing(\.accessLevel) { oldSymbol in
367367
max(oldSymbol.accessLevel, extensionBlockSymbol.accessLevel)
368-
} ?? createExtendedTypeSymbolAndAnchestors(extensionBlockSymbol, extendedSymbolId)
368+
} ?? createExtendedTypeSymbolAndAncestors(extensionBlockSymbol, extendedSymbolId)
369369

370370
pathComponentToExtendedTypeMapping[symbol.pathComponents[...]] = symbol.identifier.precise
371371

@@ -385,7 +385,7 @@ extension ExtendedTypeFormatTransformation {
385385
/// - ``SymbolKit/SymbolGraph/Symbol/KindIdentifier/unknownExtendedType``
386386
///
387387
/// If a nested type is extended, but its parent (or another ancestor) is not, this ancestor is not part of the
388-
/// extension block symbol format. In that case, a extended type symbol of unknown kind is synthesized by
388+
/// extension block symbol format. In that case, an extended type symbol of unknown kind is synthesized by
389389
/// this function. However, if the ancestor symbol is extended, the `extendedTypeSymbols` should
390390
/// already contain the respective symbol. In that case, the ``SymbolKit/SymbolGraph/Relationship/inContextOf``
391391
/// is attached to the existing symbol.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ enum GeneratedDocumentationTopics {
220220
}
221221
}
222222

223-
/// Creates a API collection in the given documentation context for all inherited symbols according to the symbol graph.
223+
/// Creates an API collection in the given documentation context for all inherited symbols according to the symbol graph.
224224
///
225225
/// Inspects the given symbol relationships and extracts all inherited symbols into a separate level in the documentation hierarchy -
226226
/// an API collection called "Inherited APIs" where all inherited symbols are listed unless they are manually curated in

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ enum SymbolGraphConcurrentDecoder {
104104
// Wait until all concurrent tasks have completed.
105105
group.wait()
106106

107-
// If an error happend during decoding re-throw.
107+
// If an error happened during decoding re-throw.
108108
if let lastError = decodeError.sync({ $0 }) {
109109
throw lastError
110110
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ struct SymbolGraphLoader {
258258
/// Returns the module name, if any, in the file name of a given symbol-graph URL.
259259
///
260260
/// Returns "Combine", if it's a main symbol-graph file, such as "Combine.symbols.json".
261-
/// Returns "Swift", if it's an extension file such as, "[email protected]".
261+
/// Returns "Swift", if it's an extension file such as, "[email protected]".
262262
/// - parameter url: A URL to a symbol graph file.
263263
/// - returns: A module name, or `nil` if the file name cannot be parsed.
264264
static func moduleNameFor(_ url: URL) -> String? {

Sources/SwiftDocC/Infrastructure/Workspace/DocumentationWorkspace.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import Foundation
2020
/// ``DocumentationContextDataProvider/bundles`` and allows the context to access the contents of the various bundles without knowing any specifics
2121
/// of its source (files on disk, a database, or a web services).
2222
///
23-
/// The second lets the the workspace notify the context when bundles are added or removed so that the context stays up to date, even after the context is created.
23+
/// The second lets the workspace notify the context when bundles are added or removed so that the context stays up to date, even after the context is created.
2424
///
2525
/// ```
2626
/// ┌─────┐

Sources/SwiftDocC/Infrastructure/Workspace/DocumentationWorkspaceDataProvider.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public protocol DocumentationWorkspaceDataProvider {
1515
/// A string that uniquely identifies this data provider.
1616
///
1717
/// Unless your implementation needs a stable identifier to associate with an external system, it's reasonable to
18-
/// use `UUID().uuidString` for the provider's identifier.
18+
/// use `UUID().uuidString` for the provider's identifier.
1919
var identifier: String { get }
2020

2121
/// Returns the data backing one of the files that this data provider provides.

0 commit comments

Comments
 (0)