Skip to content

Commit 13feeb5

Browse files
committed
Format the code
1 parent 33b4950 commit 13feeb5

File tree

2 files changed

+12
-11
lines changed

2 files changed

+12
-11
lines changed

Sources/SourceKitLSP/Swift/Diagnostic.swift

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,9 @@ extension CodeAction {
6161
init?(_ fixIt: FixIt, in snapshot: DocumentSnapshot) {
6262
var textEdits = [TextEdit]()
6363
for edit in fixIt.edits {
64-
guard let startPosition = snapshot.position(of:edit.range.lowerBound),
65-
let endPosition = snapshot.position(of:edit.range.upperBound) else {
64+
guard let startPosition = snapshot.position(of: edit.range.lowerBound),
65+
let endPosition = snapshot.position(of: edit.range.upperBound)
66+
else {
6667
continue
6768
}
6869
textEdits.append(TextEdit(range: startPosition..<endPosition, newText: edit.replacement))

Tests/SourceKitLSPTests/CodeActionTests.swift

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ final class CodeActionTests: XCTestCase {
429429
func testCodeActionForFixItsProducedBySwiftSyntax() async throws {
430430
let ws = try await MultiFileTestWorkspace(files: [
431431
"test.swift": "protocol 1️⃣Multi 2️⃣ident 3️⃣{}",
432-
"compile_commands.json": "[]"
432+
"compile_commands.json": "[]",
433433
])
434434

435435
let (uri, positions) = try ws.openDocument("test.swift")
@@ -446,29 +446,29 @@ final class CodeActionTests: XCTestCase {
446446

447447
let expectedCodeActions = [
448448
CodeAction(
449-
title: "Join the identifiers together",
450-
kind: .quickFix,
449+
title: "Join the identifiers together",
450+
kind: .quickFix,
451451
edit: WorkspaceEdit(
452452
changes: [
453-
uri : [
453+
uri: [
454454
TextEdit(range: positions["1️⃣"]..<positions["2️⃣"], newText: "Multiident "),
455455
TextEdit(range: positions["2️⃣"]..<positions["3️⃣"], newText: ""),
456456
]
457457
]
458458
)
459-
),
459+
),
460460
CodeAction(
461461
title: "Join the identifiers together with camel-case",
462-
kind: .quickFix,
463-
edit: WorkspaceEdit(
462+
kind: .quickFix,
463+
edit: WorkspaceEdit(
464464
changes: [
465-
uri : [
465+
uri: [
466466
TextEdit(range: positions["1️⃣"]..<positions["2️⃣"], newText: "MultiIdent "),
467467
TextEdit(range: positions["2️⃣"]..<positions["3️⃣"], newText: ""),
468468
]
469469
]
470470
)
471-
)
471+
),
472472
]
473473
XCTAssertEqual(expectedCodeActions, codeActions)
474474
}

0 commit comments

Comments
 (0)