File tree Expand file tree Collapse file tree 2 files changed +18
-17
lines changed
Sources/SourceKitLSP/Swift/CodeActions Expand file tree Collapse file tree 2 files changed +18
-17
lines changed Original file line number Diff line number Diff line change 10
10
//
11
11
//===----------------------------------------------------------------------===//
12
12
13
+ import SwiftParser
13
14
import SwiftRefactor
14
15
import SwiftSyntax
15
- import SwiftParser
16
16
17
17
/// Insert a documentation template associated with a function.
18
18
///
@@ -62,12 +62,14 @@ public struct UpdateDocumentation: SyntaxRefactoringProvider {
62
62
} else {
63
63
content. append ( . docLineComment( " /// - Parameters: " ) )
64
64
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
+ )
71
73
content. append ( . docLineComment( " /// " ) )
72
74
content. append ( . newlines( 1 ) )
73
75
}
Original file line number Diff line number Diff line change 10
10
//
11
11
//===----------------------------------------------------------------------===//
12
12
13
+ @_spi ( Testing) import SourceKitLSP
13
14
import SwiftParser
14
15
import SwiftRefactor
15
16
import SwiftSyntax
16
17
import XCTest
17
18
18
- @_spi ( Testing) import SourceKitLSP
19
-
20
19
final class SyntaxRefactorTests : XCTestCase {
21
20
func testConvertJSONToCodableStructClosure( ) throws {
22
21
try assertRefactor (
@@ -120,14 +119,14 @@ final class SyntaxRefactorTests: XCTestCase {
120
119
SourceEdit (
121
120
range: AbsolutePosition ( utf8Offset: 0 ) ..< AbsolutePosition ( utf8Offset: 70 ) ,
122
121
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
+ """
131
130
)
132
131
]
133
132
)
You can’t perform that action at this time.
0 commit comments