Skip to content

Commit d145cb2

Browse files
authored
Merge pull request #2881 from jaredgrubb/jaredgrubb-fix-wrong-doc-comments
Fix all documentation warnings about mislabeled parameters
2 parents b47d442 + 7973ebb commit d145cb2

File tree

9 files changed

+21
-21
lines changed

9 files changed

+21
-21
lines changed

CodeGeneration/Sources/generate-swift-syntax/templates/swiftsyntax/SyntaxRewriterFile.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ let syntaxRewriterFile = SourceFileSyntax(leadingTrivia: copyrightHeader) {
8888
DeclSyntax(
8989
"""
9090
/// Visit a ``TokenSyntax``.
91-
/// - Parameter node: the node that is being visited
91+
/// - Parameter token: the token that is being visited
9292
/// - Returns: the rewritten node
9393
open func visit(_ token: TokenSyntax) -> TokenSyntax {
9494
return token

CodeGeneration/Sources/generate-swift-syntax/templates/swiftsyntax/SyntaxVisitorFile.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ let syntaxVisitorFile = SourceFileSyntax(leadingTrivia: copyrightHeader) {
8484
DeclSyntax(
8585
"""
8686
/// Visiting ``TokenSyntax`` specifically.
87-
/// - Parameter node: the node we are visiting.
87+
/// - Parameter token: the token we are visiting.
8888
/// - Returns: how should we continue visiting.
8989
open func visit(_ token: TokenSyntax) -> SyntaxVisitorContinueKind {
9090
return .visitChildren

CodeGeneration/Sources/generate-swift-syntax/templates/swiftsyntax/TriviaPiecesFile.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,13 @@ let triviaPiecesFile = SourceFileSyntax(leadingTrivia: copyrightHeader) {
5555
/// Prints the provided trivia as they would be written in a source file.
5656
///
5757
/// - Parameter stream: The stream to which to print the trivia.
58-
public func write(to target: inout some TextOutputStream)
58+
public func write(to stream: inout some TextOutputStream)
5959
"""
6060
) {
6161
DeclSyntax(
6262
"""
6363
func printRepeated(_ character: String, count: Int) {
64-
for _ in 0..<count { target.write(character) }
64+
for _ in 0..<count { stream.write(character) }
6565
}
6666
"""
6767
)
@@ -75,7 +75,7 @@ let triviaPiecesFile = SourceFileSyntax(leadingTrivia: copyrightHeader) {
7575
}
7676
} else {
7777
SwitchCaseSyntax("case let .\(trivia.enumCaseName)(text):") {
78-
ExprSyntax("target.write(text)")
78+
ExprSyntax("stream.write(text)")
7979
}
8080
}
8181
}

Sources/SwiftSyntax/SyntaxProtocol.swift

+4-4
Original file line numberDiff line numberDiff line change
@@ -583,9 +583,9 @@ extension SyntaxProtocol {
583583

584584
/// Prints the raw value of this node to the provided stream.
585585
/// - Parameter stream: The stream to which to print the raw tree.
586-
public func write<Target>(to target: inout Target)
586+
public func write<Target>(to stream: inout Target)
587587
where Target: TextOutputStream {
588-
Syntax(self).raw.write(to: &target)
588+
Syntax(self).raw.write(to: &stream)
589589
}
590590

591591
/// A copy of this node without the leading trivia of the first token in the
@@ -667,8 +667,8 @@ extension SyntaxProtocol {
667667
/// `[startLine:startCol...endLine:endCol]` to each node.
668668
/// - mark: Adds `***` around the given node, intended to highlight it in
669669
/// the dump.
670-
/// - indentLevel: The starting indent level, 0 by default. Each level is 2
671-
/// spaces.
670+
/// - indentString: The starting indentation, empty by default. Each
671+
/// additional indentation will add 2 spaces.
672672
public func debugDescription(
673673
includeTrivia: Bool = false,
674674
converter: SourceLocationConverter? = nil,

Sources/SwiftSyntax/Trivia.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -140,9 +140,9 @@ extension Trivia: TextOutputStreamable {
140140
/// Prints the provided trivia as they would be written in a source file.
141141
///
142142
/// - Parameter stream: The stream to which to print the trivia.
143-
public func write(to target: inout some TextOutputStream) {
143+
public func write(to stream: inout some TextOutputStream) {
144144
for piece in pieces {
145-
piece.write(to: &target)
145+
piece.write(to: &stream)
146146
}
147147
}
148148
}

Sources/SwiftSyntax/generated/SyntaxRewriter.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ open class SyntaxRewriter {
5959
}
6060

6161
/// Visit a ``TokenSyntax``.
62-
/// - Parameter node: the node that is being visited
62+
/// - Parameter token: the token that is being visited
6363
/// - Returns: the rewritten node
6464
open func visit(_ token: TokenSyntax) -> TokenSyntax {
6565
return token

Sources/SwiftSyntax/generated/SyntaxVisitor.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -3465,7 +3465,7 @@ open class SyntaxVisitor {
34653465
}
34663466

34673467
/// Visiting ``TokenSyntax`` specifically.
3468-
/// - Parameter node: the node we are visiting.
3468+
/// - Parameter token: the token we are visiting.
34693469
/// - Returns: how should we continue visiting.
34703470
open func visit(_ token: TokenSyntax) -> SyntaxVisitorContinueKind {
34713471
return .visitChildren

Sources/SwiftSyntax/generated/TriviaPieces.swift

+7-7
Original file line numberDiff line numberDiff line change
@@ -55,29 +55,29 @@ extension TriviaPiece: TextOutputStreamable {
5555
/// Prints the provided trivia as they would be written in a source file.
5656
///
5757
/// - Parameter stream: The stream to which to print the trivia.
58-
public func write(to target: inout some TextOutputStream) {
58+
public func write(to stream: inout some TextOutputStream) {
5959
func printRepeated(_ character: String, count: Int) {
6060
for _ in 0 ..< count {
61-
target.write(character)
61+
stream.write(character)
6262
}
6363
}
6464
switch self {
6565
case let .backslashes(count):
6666
printRepeated(#"\"#, count: count)
6767
case let .blockComment(text):
68-
target.write(text)
68+
stream.write(text)
6969
case let .carriageReturns(count):
7070
printRepeated("\r", count: count)
7171
case let .carriageReturnLineFeeds(count):
7272
printRepeated("\r\n", count: count)
7373
case let .docBlockComment(text):
74-
target.write(text)
74+
stream.write(text)
7575
case let .docLineComment(text):
76-
target.write(text)
76+
stream.write(text)
7777
case let .formfeeds(count):
7878
printRepeated("\u{c}", count: count)
7979
case let .lineComment(text):
80-
target.write(text)
80+
stream.write(text)
8181
case let .newlines(count):
8282
printRepeated("\n", count: count)
8383
case let .pounds(count):
@@ -87,7 +87,7 @@ extension TriviaPiece: TextOutputStreamable {
8787
case let .tabs(count):
8888
printRepeated("\t", count: count)
8989
case let .unexpectedText(text):
90-
target.write(text)
90+
stream.write(text)
9191
case let .verticalTabs(count):
9292
printRepeated("\u{b}", count: count)
9393
}

Sources/SwiftSyntaxMacros/MacroProtocols/MemberMacro.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public protocol MemberMacro: AttachedMacro {
4141
/// - Parameters:
4242
/// - node: The custom attribute describing the attached macro.
4343
/// - declaration: The declaration the macro attribute is attached to.
44-
/// - conformingTo: The set of protocols that were declared
44+
/// - protocols: The set of protocols that were declared
4545
/// in the set of conformances for the macro and to which the declaration
4646
/// does not explicitly conform. The member macro itself cannot declare
4747
/// conformances to these protocols (only an extension macro can do that),

0 commit comments

Comments
 (0)