Skip to content

Commit c7d1fd1

Browse files
committed
Format files
1 parent 4079238 commit c7d1fd1

File tree

5 files changed

+11
-17
lines changed

5 files changed

+11
-17
lines changed

Sources/SourceKitBazelBSP/RequestHandlers/InitializeHandler.swift

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,10 +204,11 @@ final class InitializeHandler {
204204
data: SourceKitInitializeBuildResponseData(
205205
indexDatabasePath: initializedConfig.indexDatabasePath,
206206
indexStorePath: initializedConfig.indexStorePath,
207-
// multiTargetPreparation: MultiTargetPreparationSupport(
208-
// supported: true,
209-
// batchSize: batchSize
210-
// ),
207+
// Commented out on purpose while we get batching working upstream
208+
// multiTargetPreparation: MultiTargetPreparationSupport(
209+
// supported: true,
210+
// batchSize: batchSize
211+
// ),
211212
outputPathsProvider: nil,
212213
prepareProvider: true,
213214
sourceKitOptionsProvider: true,

Sources/SourceKitBazelBSP/RequestHandlers/TargetSourcesHandler.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,12 @@ final class TargetSourcesHandler {
113113
SourceItem(
114114
uri: src,
115115
kind: .file,
116-
generated: false, // FIXME: Need to handle this properly
116+
generated: false, // FIXME: Need to handle this properly
117117
dataKind: .sourceKit,
118118
data: SourceKitSourceItemData(
119119
language: language,
120120
kind: kind,
121-
outputPath: nil, // FIXME: Related to the same flag on initialize?
121+
outputPath: nil, // FIXME: Related to the same flag on initialize?
122122
copyDestinations: copyDestinations
123123
).encodeToLSPAny()
124124
)

Sources/SourceKitBazelBSP/Server/LSPConnection.swift

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,10 @@ package protocol LSPTaskLogger: AnyObject {
3030
/// Extends the original sourcekit-lsp `Connection` type to include JSONRPCConnection's start method
3131
/// and task logging utilities.
3232
package protocol LSPConnection: Connection, LSPTaskLogger, AnyObject {
33-
func startJSONRPC(receiveHandler: MessageHandler, closeHandler: @escaping @Sendable () async -> Void)
33+
func start(receiveHandler: MessageHandler, closeHandler: nonisolated(nonsending) @escaping @Sendable () async -> Void)
3434
}
3535

3636
extension JSONRPCConnection: LSPConnection {
37-
package func startJSONRPC(
38-
receiveHandler: any LanguageServerProtocol.MessageHandler,
39-
closeHandler: @escaping @Sendable () async -> Void
40-
) {
41-
self.start(receiveHandler: receiveHandler, closeHandler: closeHandler as nonisolated(nonsending) @Sendable () async -> Void)
42-
}
43-
4437
package func startWorkTask(id: TaskId, title: String) {
4538
send(TaskStartNotification(taskId: id, data: WorkDoneProgressTask(title: title).encodeToLSPAny()))
4639
}

Sources/SourceKitBazelBSP/Server/SourceKitBazelBSPServer.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ package final class SourceKitBazelBSPServer {
108108
) {
109109
let connection = JSONRPCConnection(
110110
name: "sourcekit-lsp",
111-
protocol: BuildServerProtocol.bspRegistry,
111+
protocol: MessageRegistry.bspProtocol,
112112
inFD: inputHandle,
113113
outFD: outputHandle
114114
)
@@ -130,7 +130,7 @@ package final class SourceKitBazelBSPServer {
130130
package func run(parkThread: Bool = true) {
131131
logger.info("Connecting to sourcekit-lsp...")
132132

133-
connection.startJSONRPC(
133+
connection.start(
134134
receiveHandler: handler,
135135
closeHandler: {
136136
logger.info("Connection closed, exiting.")

Tests/SourceKitBazelBSPTests/Fakes/LSPConnectionFake.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ final class LSPConnectionFake: LSPConnection {
2828
nonisolated(unsafe) private(set) var startReceivedHandler: MessageHandler?
2929
nonisolated(unsafe) private(set) var sentNotifications: [any NotificationType] = []
3030

31-
func startJSONRPC(receiveHandler: MessageHandler, closeHandler: @escaping @Sendable () async -> Void) {
31+
func start(receiveHandler: MessageHandler, closeHandler: @escaping @Sendable () async -> Void) {
3232
startCalled = true
3333
startReceivedHandler = receiveHandler
3434
}

0 commit comments

Comments
 (0)