Skip to content

Fix all documentation warnings about mislabeled parameters #2881

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ let syntaxRewriterFile = SourceFileSyntax(leadingTrivia: copyrightHeader) {
DeclSyntax(
"""
/// Visit a ``TokenSyntax``.
/// - Parameter node: the node that is being visited
/// - Parameter token: the token that is being visited
/// - Returns: the rewritten node
open func visit(_ token: TokenSyntax) -> TokenSyntax {
return token
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ let syntaxVisitorFile = SourceFileSyntax(leadingTrivia: copyrightHeader) {
DeclSyntax(
"""
/// Visiting ``TokenSyntax`` specifically.
/// - Parameter node: the node we are visiting.
/// - Parameter token: the token we are visiting.
/// - Returns: how should we continue visiting.
open func visit(_ token: TokenSyntax) -> SyntaxVisitorContinueKind {
return .visitChildren
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,13 @@ let triviaPiecesFile = SourceFileSyntax(leadingTrivia: copyrightHeader) {
/// Prints the provided trivia as they would be written in a source file.
///
/// - Parameter stream: The stream to which to print the trivia.
public func write(to target: inout some TextOutputStream)
public func write(to stream: inout some TextOutputStream)
"""
) {
DeclSyntax(
"""
func printRepeated(_ character: String, count: Int) {
for _ in 0..<count { target.write(character) }
for _ in 0..<count { stream.write(character) }
}
"""
)
Expand All @@ -75,7 +75,7 @@ let triviaPiecesFile = SourceFileSyntax(leadingTrivia: copyrightHeader) {
}
} else {
SwitchCaseSyntax("case let .\(trivia.enumCaseName)(text):") {
ExprSyntax("target.write(text)")
ExprSyntax("stream.write(text)")
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions Sources/SwiftSyntax/SyntaxProtocol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -583,9 +583,9 @@ extension SyntaxProtocol {

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

/// A copy of this node without the leading trivia of the first token in the
Expand Down Expand Up @@ -667,8 +667,8 @@ extension SyntaxProtocol {
/// `[startLine:startCol...endLine:endCol]` to each node.
/// - mark: Adds `***` around the given node, intended to highlight it in
/// the dump.
/// - indentLevel: The starting indent level, 0 by default. Each level is 2
/// spaces.
/// - indentString: The starting indentation, empty by default. Each
/// additional indentation will add 2 spaces.
public func debugDescription(
includeTrivia: Bool = false,
converter: SourceLocationConverter? = nil,
Expand Down
4 changes: 2 additions & 2 deletions Sources/SwiftSyntax/Trivia.swift
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,9 @@ extension Trivia: TextOutputStreamable {
/// Prints the provided trivia as they would be written in a source file.
///
/// - Parameter stream: The stream to which to print the trivia.
public func write(to target: inout some TextOutputStream) {
public func write(to stream: inout some TextOutputStream) {
for piece in pieces {
piece.write(to: &target)
piece.write(to: &stream)
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/SwiftSyntax/generated/SyntaxRewriter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ open class SyntaxRewriter {
}

/// Visit a ``TokenSyntax``.
/// - Parameter node: the node that is being visited
/// - Parameter token: the token that is being visited
/// - Returns: the rewritten node
open func visit(_ token: TokenSyntax) -> TokenSyntax {
return token
Expand Down
2 changes: 1 addition & 1 deletion Sources/SwiftSyntax/generated/SyntaxVisitor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3465,7 +3465,7 @@ open class SyntaxVisitor {
}

/// Visiting ``TokenSyntax`` specifically.
/// - Parameter node: the node we are visiting.
/// - Parameter token: the token we are visiting.
/// - Returns: how should we continue visiting.
open func visit(_ token: TokenSyntax) -> SyntaxVisitorContinueKind {
return .visitChildren
Expand Down
14 changes: 7 additions & 7 deletions Sources/SwiftSyntax/generated/TriviaPieces.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,29 +55,29 @@ extension TriviaPiece: TextOutputStreamable {
/// Prints the provided trivia as they would be written in a source file.
///
/// - Parameter stream: The stream to which to print the trivia.
public func write(to target: inout some TextOutputStream) {
public func write(to stream: inout some TextOutputStream) {
func printRepeated(_ character: String, count: Int) {
for _ in 0 ..< count {
target.write(character)
stream.write(character)
}
}
switch self {
case let .backslashes(count):
printRepeated(#"\"#, count: count)
case let .blockComment(text):
target.write(text)
stream.write(text)
case let .carriageReturns(count):
printRepeated("\r", count: count)
case let .carriageReturnLineFeeds(count):
printRepeated("\r\n", count: count)
case let .docBlockComment(text):
target.write(text)
stream.write(text)
case let .docLineComment(text):
target.write(text)
stream.write(text)
case let .formfeeds(count):
printRepeated("\u{c}", count: count)
case let .lineComment(text):
target.write(text)
stream.write(text)
case let .newlines(count):
printRepeated("\n", count: count)
case let .pounds(count):
Expand All @@ -87,7 +87,7 @@ extension TriviaPiece: TextOutputStreamable {
case let .tabs(count):
printRepeated("\t", count: count)
case let .unexpectedText(text):
target.write(text)
stream.write(text)
case let .verticalTabs(count):
printRepeated("\u{b}", count: count)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public protocol MemberMacro: AttachedMacro {
/// - Parameters:
/// - node: The custom attribute describing the attached macro.
/// - declaration: The declaration the macro attribute is attached to.
/// - conformingTo: The set of protocols that were declared
/// - protocols: The set of protocols that were declared
/// in the set of conformances for the macro and to which the declaration
/// does not explicitly conform. The member macro itself cannot declare
/// conformances to these protocols (only an extension macro can do that),
Expand Down