Remove the Notification type

`Notification` is just a wrapper around `NotificationType` and there’s no reason for it to exist anymore.

Resolves #880
rdar://116705670
This commit is contained in:
Alex Hoppen
2023-10-26 13:37:32 -07:00
parent 7772f0721d
commit 9abcd2a3a3
9 changed files with 43 additions and 74 deletions

View File

@@ -193,9 +193,9 @@ public actor BuildServerBuildSystem: MessageHandler {
public nonisolated func handle(_ params: some NotificationType, from clientID: ObjectIdentifier) {
bspMessageHandlingQueue.async {
if let params = params as? BuildTargetsChangedNotification {
await self.handleBuildTargetsChanged(Notification(params, clientID: clientID))
await self.handleBuildTargetsChanged(params)
} else if let params = params as? FileOptionsChangedNotification {
await self.handleFileOptionsChanged(Notification(params, clientID: clientID))
await self.handleFileOptionsChanged(params)
}
}
}
@@ -213,20 +213,20 @@ public actor BuildServerBuildSystem: MessageHandler {
}
func handleBuildTargetsChanged(
_ notification: LanguageServerProtocol.Notification<BuildTargetsChangedNotification>
_ notification: BuildTargetsChangedNotification
) async {
await self.delegate?.buildTargetsChanged(notification.params.changes)
await self.delegate?.buildTargetsChanged(notification.changes)
}
func handleFileOptionsChanged(
_ notification: LanguageServerProtocol.Notification<FileOptionsChangedNotification>
_ notification: FileOptionsChangedNotification
) async {
let result = notification.params.updatedOptions
let result = notification.updatedOptions
let settings = FileBuildSettings(
compilerArguments: result.options,
workingDirectory: result.workingDirectory
)
await self.buildSettingsChanged(for: notification.params.uri, settings: settings)
await self.buildSettingsChanged(for: notification.uri, settings: settings)
}
/// Record the new build settings for the given document and inform the delegate