Skip to content

Commit

Permalink
Restore some removed functions, but mark deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
mattmassicotte committed Nov 28, 2023
1 parent 1268f52 commit d4b9a4e
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions Sources/LSPClient/Client.ServerConnection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,38 @@ public extension ServerConnection {
try await sendNotification(.textDocumentDidOpen(params))
}

@available(*, deprecated, renamed: "textDocumentDidOpen", message: "This method has been renamed to better match the spec.")
func didOpenTextDocument(params: DidOpenTextDocumentParams) async throws {
try await textDocumentDidOpen(params: params)
}

func textDocumentDidChange(params: DidChangeTextDocumentParams) async throws {
try await sendNotification(.textDocumentDidChange(params))
}

@available(*, deprecated, renamed: "textDocumentDidChange", message: "This method has been renamed to better match the spec.")
func didChangeTextDocument(params: DidChangeTextDocumentParams) async throws {
try await textDocumentDidChange(params: params)
}

func textDocumentDidClose(params: DidCloseTextDocumentParams) async throws {
try await sendNotification(.textDocumentDidClose(params))
}

@available(*, deprecated, renamed: "didCloseTextDocument", message: "This method has been renamed to better match the spec.")
func didCloseTextDocument(params: DidCloseTextDocumentParams) async throws {
try await textDocumentDidClose(params: params)
}

func textDocumentWillSave(params: WillSaveTextDocumentParams) async throws {
try await sendNotification(.textDocumentWillSave(params))
}

@available(*, deprecated, renamed: "textDocumentWillSave", message: "This method has been renamed to better match the spec.")
func willSaveTextDocument(params: WillSaveTextDocumentParams) async throws {
try await textDocumentWillSave(params: params)
}

func textDocumentWillSaveWaitUntil(params: WillSaveTextDocumentParams) async throws -> WillSaveWaitUntilResponse {
try await sendRequest(.textDocumentWillSaveWaitUntil(params, ClientRequest.NullHandler))
}
Expand All @@ -72,6 +92,11 @@ public extension ServerConnection {
try await sendNotification(.workspaceDidChangeWatchedFiles(params))
}

@available(*, deprecated, renamed: "workspaceDidChangeWatchedFiles", message: "This method has been renamed to better match the spec.")
func didChangeWatchedFiles(params: DidChangeWatchedFilesParams) async throws {
try await workspaceDidChangeWatchedFiles(params: params)
}

func callHierarchyIncomingCalls(params: CallHierarchyIncomingCallsParams) async throws -> CallHierarchyIncomingCallsResponse {
try await sendRequest(.callHierarchyIncomingCalls(params, ClientRequest.NullHandler))
}
Expand Down

0 comments on commit d4b9a4e

Please sign in to comment.