Skip to content

Commit 34acdb0

Browse files
committed
Don’t fatalError for Fix-Its that make no changes
1 parent 8e9c19a commit 34acdb0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Sources/SourceKitLSP/Swift/Diagnostic.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,8 @@ extension CodeAction {
110110
case (true, false):
111111
return "Insert '\(newText)'"
112112
case (true, true):
113-
preconditionFailure("FixIt makes no changes")
113+
logger.fault("Both oldText and newText of FixIt are empty")
114+
return "Fix"
114115
}
115116
}
116117
}

0 commit comments

Comments
 (0)