Skip to content

Commit 76b07ca

Browse files
committed
Make KeyBindingManager import conditional
1 parent 2c7664c commit 76b07ca

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Core/Sources/Service/Service.swift

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import Foundation
2+
#if canImport(KeyBindingManager)
23
import KeyBindingManager
4+
#endif
35
import Workspace
46

57
@globalActor public enum ServiceActor {
@@ -24,10 +26,13 @@ public final class Service {
2426
public let guiController = GraphicalUserInterfaceController()
2527
public let realtimeSuggestionController = RealtimeSuggestionController()
2628
public let scheduledCleaner: ScheduledCleaner
29+
#if canImport(KeyBindingManager)
2730
let keyBindingManager: KeyBindingManager
31+
#endif
2832

2933
private init() {
3034
scheduledCleaner = .init(workspacePool: workspacePool, guiController: guiController)
35+
#if canImport(KeyBindingManager)
3136
keyBindingManager = .init(
3237
workspacePool: workspacePool,
3338
acceptSuggestion: {
@@ -36,14 +41,17 @@ public final class Service {
3641
}
3742
}
3843
)
44+
#endif
3945
}
40-
46+
4147
@MainActor
4248
public func start() {
4349
scheduledCleaner.start()
4450
realtimeSuggestionController.start()
4551
guiController.start()
52+
#if canImport(KeyBindingManager)
4653
keyBindingManager.start()
54+
#endif
4755
DependencyUpdater().update()
4856
}
4957
}

0 commit comments

Comments
 (0)