Skip to content

Commit 2a99abd

Browse files
authored
Merge pull request #1593 from ahoppen/swift-6-cmake
Build in Swift 6 mode using CMake
2 parents 652640b + 03de5c1 commit 2a99abd

File tree

5 files changed

+18
-0
lines changed

5 files changed

+18
-0
lines changed

Sources/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
add_compile_options("$<$<COMPILE_LANGUAGE:Swift>:SHELL:-package-name SourceKitLSP>")
2+
add_compile_options("$<$<COMPILE_LANGUAGE:Swift>:SHELL:-DRESILIENT_LIBRARIES>")
3+
add_compile_options("$<$<COMPILE_LANGUAGE:Swift>:SHELL:-swift-version 6>")
24
add_subdirectory(BuildServerProtocol)
35
add_subdirectory(BuildSystemIntegration)
46
add_subdirectory(CAtomics)

Sources/SourceKitLSP/Swift/CodeActions/ConvertIntegerLiteral.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ struct ConvertIntegerLiteral: SyntaxCodeActionProvider {
5151
prefix = "0x"
5252
case .decimal:
5353
prefix = ""
54+
#if RESILIENT_LIBRARIES
55+
@unknown default:
56+
fatalError("Unknown case")
57+
#endif
5458
}
5559

5660
let convertedValue: ExprSyntax =

Sources/SourceKitLSP/Swift/Diagnostic.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,10 @@ fileprivate extension SwiftDiagnostics.DiagnosticSeverity {
423423
case .warning: return .warning
424424
case .note: return .information
425425
case .remark: return .hint
426+
#if RESILIENT_LIBRARIES
427+
@unknown default:
428+
fatalError("Unknown case")
429+
#endif
426430
}
427431
}
428432
}

Sources/SourceKitLSP/Swift/RewriteSourceKitPlaceholders.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@ fileprivate extension EditorPlaceholderData {
3838
switch self {
3939
case .basic(text: let text): return text
4040
case .typed(text: let text, type: _): return text
41+
#if RESILIENT_LIBRARIES
42+
@unknown default:
43+
fatalError("Unknown case")
44+
#endif
4145
}
4246
}
4347
}

Sources/SourceKitLSP/Swift/SemanticTokens.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,10 @@ extension SyntaxClassification {
151151
return (.comment, .documentation)
152152
case .argumentLabel:
153153
return (.function, [])
154+
#if RESILIENT_LIBRARIES
155+
@unknown default:
156+
fatalError("Unknown case")
157+
#endif
154158
}
155159
}
156160
}

0 commit comments

Comments
 (0)