diff --git a/Sources/LanguageServerProtocol/Additions/Server.swift b/Sources/LanguageServerProtocol/Additions/Server.swift index 6089e6e..f087244 100644 --- a/Sources/LanguageServerProtocol/Additions/Server.swift +++ b/Sources/LanguageServerProtocol/Additions/Server.swift @@ -45,27 +45,27 @@ public extension Server { try await sendNotification(.protocolSetTrace(params)) } - func textDocumentDidOpen(params: TextDocumentDidOpenParams) async throws { + func textDocumentDidOpen(params: DidOpenTextDocumentParams) async throws { try await sendNotification(.textDocumentDidOpen(params)) } - func textDocumentDidChange(params: TextDocumentDidChangeParams) async throws { + func textDocumentDidChange(params: DidChangeTextDocumentParams) async throws { try await sendNotification(.textDocumentDidChange(params)) } - func textDocumentDidClose(params: TextDocumentDidCloseParams) async throws { + func textDocumentDidClose(params: DidCloseTextDocumentParams) async throws { try await sendNotification(.textDocumentDidClose(params)) } - func textDocumentWillSave(params: TextDocumentWillSaveParams) async throws { + func textDocumentWillSave(params: WillSaveTextDocumentParams) async throws { try await sendNotification(.textDocumentWillSave(params)) } - func textDocumentWillSaveWaitUntil(params: TextDocumentWillSaveParams) async throws -> WillSaveWaitUntilResponse { + func textDocumentWillSaveWaitUntil(params: WillSaveTextDocumentParams) async throws -> WillSaveWaitUntilResponse { try await sendRequest(.textDocumentWillSaveWaitUntil(params)) } - func textDocumentDidSave(params: TextDocumentDidSaveParams) async throws { + func textDocumentDidSave(params: DidSaveTextDocumentParams) async throws { try await sendNotification(.textDocumentDidSave(params)) } diff --git a/Sources/LanguageServerProtocol/LanguageServerProtocol.swift b/Sources/LanguageServerProtocol/LanguageServerProtocol.swift index 74ee80e..bfec6d8 100644 --- a/Sources/LanguageServerProtocol/LanguageServerProtocol.swift +++ b/Sources/LanguageServerProtocol/LanguageServerProtocol.swift @@ -25,11 +25,11 @@ public enum ClientNotification: Sendable, Hashable { case initialized(InitializedParams) case exit - case textDocumentDidChange(TextDocumentDidChangeParams) - case textDocumentDidOpen(TextDocumentDidOpenParams) - case textDocumentDidClose(TextDocumentDidCloseParams) - case textDocumentWillSave(TextDocumentWillSaveParams) - case textDocumentDidSave(TextDocumentDidSaveParams) + case textDocumentDidChange(DidChangeTextDocumentParams) + case textDocumentDidOpen(DidOpenTextDocumentParams) + case textDocumentDidClose(DidCloseTextDocumentParams) + case textDocumentWillSave(WillSaveTextDocumentParams) + case textDocumentDidSave(DidSaveTextDocumentParams) case protocolCancelRequest(CancelParams) case protocolSetTrace(SetTraceParams) case windowWorkDoneProgressCancel(WorkDoneProgressCancelParams) @@ -136,7 +136,7 @@ public enum ClientRequest: Sendable, Hashable { case workspaceWillDeleteFiles(DeleteFilesParams) case workspaceSymbol(WorkspaceSymbolParams) case workspaceSymbolResolve(WorkspaceSymbol) - case textDocumentWillSaveWaitUntil(TextDocumentWillSaveParams) + case textDocumentWillSaveWaitUntil(WillSaveTextDocumentParams) case completion(CompletionParams) case completionItemResolve(CompletionItem) case hover(TextDocumentPositionParams) diff --git a/Sources/LanguageServerProtocol/TextSynchronization.swift b/Sources/LanguageServerProtocol/TextSynchronization.swift index 5a47955..829c0ad 100644 --- a/Sources/LanguageServerProtocol/TextSynchronization.swift +++ b/Sources/LanguageServerProtocol/TextSynchronization.swift @@ -1,6 +1,6 @@ import Foundation -public struct TextDocumentDidOpenParams: Codable, Hashable, Sendable { +public struct DidOpenTextDocumentParams: Codable, Hashable, Sendable { public let textDocument: TextDocumentItem public init(textDocument: TextDocumentItem) { @@ -20,7 +20,7 @@ public struct TextDocumentContentChangeEvent: Codable, Hashable, Sendable { } } -public struct TextDocumentDidChangeParams: Codable, Hashable, Sendable { +public struct DidChangeTextDocumentParams: Codable, Hashable, Sendable { public let textDocument: VersionedTextDocumentIdentifier public let contentChanges: [TextDocumentContentChangeEvent] @@ -45,7 +45,7 @@ public struct TextDocumentChangeRegistrationOptions: Codable, Hashable, Sendable public let syncKind: TextDocumentSyncKind } -public struct TextDocumentDidSaveParams: Codable, Hashable, Sendable { +public struct DidSaveTextDocumentParams: Codable, Hashable, Sendable { public let textDocument: TextDocumentIdentifier public let text: String? @@ -67,7 +67,7 @@ public struct TextDocumentSaveRegistrationOptions: Codable, Hashable, Sendable { public let includeText: Bool? } -public struct TextDocumentDidCloseParams: Codable, Hashable, Sendable { +public struct DidCloseTextDocumentParams: Codable, Hashable, Sendable { public let textDocument: TextDocumentIdentifier public init(textDocument: TextDocumentIdentifier) { @@ -87,7 +87,7 @@ public enum TextDocumentSaveReason: Int, Codable, Hashable, Sendable { case focusOut = 3 } -public struct TextDocumentWillSaveParams: Codable, Hashable, Sendable { +public struct WillSaveTextDocumentParams: Codable, Hashable, Sendable { public let textDocument: TextDocumentIdentifier public let reason: TextDocumentSaveReason