Skip to content

Commit b2f5eba

Browse files
committed
Format
1 parent 4aef380 commit b2f5eba

File tree

2 files changed

+18
-17
lines changed

2 files changed

+18
-17
lines changed

Sources/SourceKitLSP/Swift/CodeActions/UpdateDocumentation.swift

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13+
import SwiftParser
1314
import SwiftRefactor
1415
import SwiftSyntax
15-
import SwiftParser
1616

1717
/// Insert a documentation template associated with a function.
1818
///
@@ -62,12 +62,14 @@ public struct UpdateDocumentation: SyntaxRefactoringProvider {
6262
} else {
6363
content.append(.docLineComment("/// - Parameters:"))
6464
content.append(.newlines(1))
65-
content.append(contentsOf: parameters.map({ param in
66-
[
67-
.docLineComment("/// - \((param.secondName ?? param.firstName ).trimmed):"),
68-
.newlines(1),
69-
]
70-
}).joined())
65+
content.append(
66+
contentsOf: parameters.map({ param in
67+
[
68+
.docLineComment("/// - \((param.secondName ?? param.firstName ).trimmed):"),
69+
.newlines(1),
70+
]
71+
}).joined()
72+
)
7173
content.append(.docLineComment("///"))
7274
content.append(.newlines(1))
7375
}

Tests/SourceKitLSPTests/SyntaxRefactorTests.swift

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,12 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13+
@_spi(Testing) import SourceKitLSP
1314
import SwiftParser
1415
import SwiftRefactor
1516
import SwiftSyntax
1617
import XCTest
1718

18-
@_spi(Testing) import SourceKitLSP
19-
2019
final class SyntaxRefactorTests: XCTestCase {
2120
func testConvertJSONToCodableStructClosure() throws {
2221
try assertRefactor(
@@ -120,14 +119,14 @@ final class SyntaxRefactorTests: XCTestCase {
120119
SourceEdit(
121120
range: AbsolutePosition(utf8Offset: 0)..<AbsolutePosition(utf8Offset: 70),
122121
replacement: """
123-
/// A description
124-
/// - Parameters:
125-
/// - syntax:
126-
/// - context:
127-
///
128-
/// - Returns:
129-
func refactor(syntax: DeclSyntax, in context: Void) -> DeclSyntax? { }
130-
"""
122+
/// A description
123+
/// - Parameters:
124+
/// - syntax:
125+
/// - context:
126+
///
127+
/// - Returns:
128+
func refactor(syntax: DeclSyntax, in context: Void) -> DeclSyntax? { }
129+
"""
131130
)
132131
]
133132
)

0 commit comments

Comments
 (0)