Skip to content

Commit 847524d

Browse files
authored
Merge pull request #1143 from ahoppen/ahoppen/skip-rename-test-if-not-supported
Fix issues when developing sourcekit-lsp using Xcode 15.3
2 parents 8f2fa1d + 5ecae9b commit 847524d

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

Sources/SourceKitD/DynamicallyLoadedSourceKitD.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ import SKSupport
1616

1717
import struct TSCBasic.AbsolutePath
1818

19+
#if compiler(<5.11)
20+
extension DLHandle: @unchecked Sendable {}
21+
#else
1922
extension DLHandle: @unchecked @retroactive Sendable {}
23+
#endif
2024
extension sourcekitd_api_keys: @unchecked Sendable {}
2125
extension sourcekitd_api_requests: @unchecked Sendable {}
2226
extension sourcekitd_api_values: @unchecked Sendable {}

Tests/LSPLoggingTests/LoggingTests.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ fileprivate func assertLogging(
2222
file: StaticString = #filePath,
2323
line: UInt = #line
2424
) {
25-
var messages: [String] = []
25+
// nonisolated(unsafe) because calls of `assertLogging` do not log to `logHandler` concurrently.
26+
nonisolated(unsafe) var messages: [String] = []
2627
let logger = NonDarwinLogger(
2728
subsystem: subsystem,
2829
category: "test",
@@ -71,7 +72,8 @@ fileprivate func assertLogging(
7172
final class LoggingTests: XCTestCase {
7273
func testLoggingFormat() async throws {
7374
let expectation = self.expectation(description: "message logged")
74-
var message: String = ""
75+
// nonisolated(unsafe) because we only have a single call to `logger.log` and that cannot race.
76+
nonisolated(unsafe) var message: String = ""
7577
let logger = NonDarwinLogger(
7678
subsystem: subsystem,
7779
category: "test",

Tests/SourceKitLSPTests/RenameTests.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1083,6 +1083,7 @@ final class RenameTests: XCTestCase {
10831083
}
10841084

10851085
func testRenameAfterFileMove() async throws {
1086+
try await SkipUnless.sourcekitdSupportsRename()
10861087
let project = try await SwiftPMTestProject(
10871088
files: [
10881089
"definition.swift": """

0 commit comments

Comments
 (0)