Skip to content

Commit

Permalink
Restore param naming matching spec
Browse files Browse the repository at this point in the history
  • Loading branch information
koliyo committed Oct 20, 2023
1 parent 8a00cc9 commit 87d94fb
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
12 changes: 6 additions & 6 deletions Sources/LanguageServerProtocol/Additions/Server.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}

Expand Down
12 changes: 6 additions & 6 deletions Sources/LanguageServerProtocol/LanguageServerProtocol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
10 changes: 5 additions & 5 deletions Sources/LanguageServerProtocol/TextSynchronization.swift
Original file line number Diff line number Diff line change
@@ -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) {
Expand All @@ -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]

Expand All @@ -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?

Expand All @@ -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) {
Expand All @@ -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

Expand Down

0 comments on commit 87d94fb

Please sign in to comment.