Skip to content

Commit c5a6b1c

Browse files
committed
Format changes with swift-format
1 parent 02da9fe commit c5a6b1c

File tree

2 files changed

+31
-26
lines changed

2 files changed

+31
-26
lines changed

Sources/SwiftLanguageService/CodeCompletionSession.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,8 @@ class CodeCompletionSession {
577577
}
578578

579579
if let response = documentationResponse,
580-
let docString = documentationString(from: response, sourcekitd: sourcekitd) {
580+
let docString = documentationString(from: response, sourcekitd: sourcekitd)
581+
{
581582
item.documentation = .markupContent(MarkupContent(kind: .markdown, value: docString))
582583
}
583584
}

Tests/SwiftSourceKitPluginTests/SwiftSourceKitPluginTests.swift

Lines changed: 29 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -441,34 +441,38 @@ final class SwiftSourceKitPluginTests: XCTestCase {
441441
let sym3 = try unwrap(result.items.first(where: { $0.name == "foo3()" }), "did not find foo3; got \(result.items)")
442442

443443
let sym1Doc = try await sourcekitd.completeDocumentation(id: sym1.id)
444-
XCTAssertEqual(sym1Doc.docFullAsXML,
445-
"""
446-
<Function file="\(path)" line="3" column="8">\
447-
<Name>foo1()</Name>\
448-
<USR>s:1a1PP4foo1yyF</USR>\
449-
<Declaration>func foo1()</Declaration>\
450-
<CommentParts>\
451-
<Abstract><Para>Protocol P foo1</Para></Abstract>\
452-
<Discussion><Note>\
453-
<Para>This documentation comment was inherited from <codeVoice>P</codeVoice>.</Para>\
454-
</Note></Discussion>\
455-
</CommentParts>\
456-
</Function>
457-
""")
444+
XCTAssertEqual(
445+
sym1Doc.docFullAsXML,
446+
"""
447+
<Function file="\(path)" line="3" column="8">\
448+
<Name>foo1()</Name>\
449+
<USR>s:1a1PP4foo1yyF</USR>\
450+
<Declaration>func foo1()</Declaration>\
451+
<CommentParts>\
452+
<Abstract><Para>Protocol P foo1</Para></Abstract>\
453+
<Discussion><Note>\
454+
<Para>This documentation comment was inherited from <codeVoice>P</codeVoice>.</Para>\
455+
</Note></Discussion>\
456+
</CommentParts>\
457+
</Function>
458+
"""
459+
)
458460
XCTAssertEqual(sym1Doc.associatedUSRs, ["s:1a1SV4foo1yyF", "s:1a1PP4foo1yyF"])
459461

460462
let sym2Doc = try await sourcekitd.completeDocumentation(id: sym2.id)
461-
XCTAssertEqual(sym2Doc.docFullAsXML,
462-
"""
463-
<Function file="\(path)" line="8" column="8">\
464-
<Name>foo2()</Name>\
465-
<USR>s:1a1SV4foo2yyF</USR>\
466-
<Declaration>func foo2()</Declaration>\
467-
<CommentParts>\
468-
<Abstract><Para>Struct S foo2</Para></Abstract>\
469-
</CommentParts>\
470-
</Function>
471-
""")
463+
XCTAssertEqual(
464+
sym2Doc.docFullAsXML,
465+
"""
466+
<Function file="\(path)" line="8" column="8">\
467+
<Name>foo2()</Name>\
468+
<USR>s:1a1SV4foo2yyF</USR>\
469+
<Declaration>func foo2()</Declaration>\
470+
<CommentParts>\
471+
<Abstract><Para>Struct S foo2</Para></Abstract>\
472+
</CommentParts>\
473+
</Function>
474+
"""
475+
)
472476
XCTAssertEqual(sym2Doc.associatedUSRs, ["s:1a1SV4foo2yyF"])
473477

474478
let sym3Doc = try await sourcekitd.completeDocumentation(id: sym3.id)

0 commit comments

Comments
 (0)