diff --git a/Sources/LanguageServerProtocol/JSONRPCLanguageServer.swift b/Sources/LanguageServerProtocol/JSONRPCLanguageServer.swift index 4cbce99..bed1d83 100644 --- a/Sources/LanguageServerProtocol/JSONRPCLanguageServer.swift +++ b/Sources/LanguageServerProtocol/JSONRPCLanguageServer.swift @@ -373,7 +373,7 @@ extension JSONRPCLanguageServer { sendRequestWithHandler(params, method: method, handler: completionHandler) case .codeLensResolve(let params): sendRequestWithHandler(params, method: method, handler: completionHandler) - case .prepareCallHeirarchy(let params): + case .prepareCallHierarchy(let params): sendRequestWithHandler(params, method: method, handler: completionHandler) case .prepareRename(let params): sendRequestWithHandler(params, method: method, handler: completionHandler) @@ -411,9 +411,9 @@ extension JSONRPCLanguageServer { sendRequestWithHandler(params, method: method, handler: completionHandler) case .workspaceWillDeleteFiles(let params): sendRequestWithHandler(params, method: method, handler: completionHandler) - case .callHeirarchyIncomingCalls(let params): + case .callHierarchyIncomingCalls(let params): sendRequestWithHandler(params, method: method, handler: completionHandler) - case .callHeirarchyOutgoingCalls(let params): + case .callHierarchyOutgoingCalls(let params): sendRequestWithHandler(params, method: method, handler: completionHandler) case .custom(let method, let params): sendRequestWithHandler(params, method: method, handler: completionHandler) diff --git a/Sources/LanguageServerProtocol/LanguageServerProtocol.swift b/Sources/LanguageServerProtocol/LanguageServerProtocol.swift index 29017aa..ee70fc4 100644 --- a/Sources/LanguageServerProtocol/LanguageServerProtocol.swift +++ b/Sources/LanguageServerProtocol/LanguageServerProtocol.swift @@ -111,7 +111,7 @@ public enum ClientRequest { case textDocumentOnTypeFormatting = "textDocument/onTypeFormatting" case textDocumentRename = "textDocument/rename" case textDocumentPrepareRename = "textDocument/prepareRename" - case textDocumentPrepareCallHeirarchy = "textDocument/prepareCallHierarchy" + case textDocumentPrepareCallHierarchy = "textDocument/prepareCallHierarchy" case textDocumentFoldingRange = "textDocument/foldingRange" case textDocumentSelectionRange = "textDocument/selectionRange" case textDocumentLinkedEditingRange = "textDocument/linkedEditingRange" @@ -120,8 +120,8 @@ public enum ClientRequest { case textDocumentSemanticTokensFull = "textDocument/semanticTokens/full" case textDocumentSemanticTokensFullDelta = "textDocument/semanticTokens/full/delta" case textDocumentMoniker = "textDocument/moniker" - case callHeirarchyIncomingCalls = "callHierarchy/incomingCalls" - case callHeirarchyOutgoingCalls = "callHierarchy/outgoingCalls" + case callHierarchyIncomingCalls = "callHierarchy/incomingCalls" + case callHierarchyOutgoingCalls = "callHierarchy/outgoingCalls" case custom } @@ -148,7 +148,7 @@ public enum ClientRequest { case codeLens(CodeLensParams) case codeLensResolve(CodeLens) case selectionRange(SelectionRangeParams) - case prepareCallHeirarchy(CallHierarchyPrepareParams) + case prepareCallHierarchy(CallHierarchyPrepareParams) case prepareRename(PrepareRenameParams) case rename(RenameParams) case documentLink(DocumentLinkParams) @@ -163,8 +163,8 @@ public enum ClientRequest { case semanticTokensFull(SemanticTokensParams) case semanticTokensFullDelta(SemanticTokensDeltaParams) case semanticTokensRange(SemanticTokensRangeParams) - case callHeirarchyIncomingCalls(CallHierarchyIncomingCallsParams) - case callHeirarchyOutgoingCalls(CallHierarchyOutgoingCallsParams) + case callHierarchyIncomingCalls(CallHierarchyIncomingCallsParams) + case callHierarchyOutgoingCalls(CallHierarchyOutgoingCallsParams) case custom(String, LSPAny) public var method: Method { @@ -215,8 +215,8 @@ public enum ClientRequest { return .codeLensResolve case .selectionRange: return .textDocumentSelectionRange - case .prepareCallHeirarchy: - return .textDocumentPrepareCallHeirarchy + case .prepareCallHierarchy: + return .textDocumentPrepareCallHierarchy case .prepareRename: return .textDocumentPrepareRename case .rename: @@ -245,10 +245,10 @@ public enum ClientRequest { return .textDocumentSemanticTokensFullDelta case .semanticTokensRange: return .textDocumentSemanticTokensRange - case .callHeirarchyIncomingCalls: - return .callHeirarchyIncomingCalls - case .callHeirarchyOutgoingCalls: - return .callHeirarchyOutgoingCalls + case .callHierarchyIncomingCalls: + return .callHierarchyIncomingCalls + case .callHierarchyOutgoingCalls: + return .callHierarchyOutgoingCalls case .custom: return .custom } diff --git a/Sources/LanguageServerProtocol/Server.swift b/Sources/LanguageServerProtocol/Server.swift index 83ed730..7b2eea1 100644 --- a/Sources/LanguageServerProtocol/Server.swift +++ b/Sources/LanguageServerProtocol/Server.swift @@ -98,9 +98,9 @@ public extension Server { } func sendRequest(_ request: ClientRequest) async throws -> Response { - return try await withCheckedThrowingContinuation { continutation in + return try await withCheckedThrowingContinuation { continuation in self.sendRequest(request) { result in - continutation.resume(with: result) + continuation.resume(with: result) } } } @@ -109,9 +109,9 @@ public extension Server { public extension Server { @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) func initialize(params: InitializeParams) async throws -> InitializationResponse { - return try await withCheckedThrowingContinuation { continutation in + return try await withCheckedThrowingContinuation { continuation in self.initialize(params: params) { result in - continutation.resume(with: result) + continuation.resume(with: result) } } } @@ -161,12 +161,12 @@ public extension Server { @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) func didOpenTextDocument(params: DidOpenTextDocumentParams) async throws { - try await withCheckedThrowingContinuation { (continutation: CheckedContinuation) in + try await withCheckedThrowingContinuation { (continuation: CheckedContinuation) in self.didOpenTextDocument(params: params) { error in if let error = error { - continutation.resume(throwing: error) + continuation.resume(throwing: error) } else { - continutation.resume() + continuation.resume() } } } @@ -178,12 +178,12 @@ public extension Server { @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) func didChangeTextDocument(params: DidChangeTextDocumentParams) async throws { - try await withCheckedThrowingContinuation { (continutation: CheckedContinuation) in + try await withCheckedThrowingContinuation { (continuation: CheckedContinuation) in self.didChangeTextDocument(params: params) { error in if let error = error { - continutation.resume(throwing: error) + continuation.resume(throwing: error) } else { - continutation.resume() + continuation.resume() } } } @@ -195,12 +195,12 @@ public extension Server { @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) func didCloseTextDocument(params: DidCloseTextDocumentParams) async throws { - try await withCheckedThrowingContinuation { (continutation: CheckedContinuation) in + try await withCheckedThrowingContinuation { (continuation: CheckedContinuation) in self.didCloseTextDocument(params: params) { error in if let error = error { - continutation.resume(throwing: error) + continuation.resume(throwing: error) } else { - continutation.resume() + continuation.resume() } } } @@ -212,12 +212,12 @@ public extension Server { @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) func willSaveTextDocument(params: WillSaveTextDocumentParams) async throws { - try await withCheckedThrowingContinuation { (continutation: CheckedContinuation) in + try await withCheckedThrowingContinuation { (continuation: CheckedContinuation) in self.willSaveTextDocument(params: params) { error in if let error = error { - continutation.resume(throwing: error) + continuation.resume(throwing: error) } else { - continutation.resume() + continuation.resume() } } } @@ -233,12 +233,12 @@ public extension Server { @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) func didSaveTextDocument(params: DidSaveTextDocumentParams) async throws { - try await withCheckedThrowingContinuation { (continutation: CheckedContinuation) in + try await withCheckedThrowingContinuation { (continuation: CheckedContinuation) in self.didSaveTextDocument(params: params) { error in if let error = error { - continutation.resume(throwing: error) + continuation.resume(throwing: error) } else { - continutation.resume() + continuation.resume() } } } @@ -250,39 +250,39 @@ public extension Server { @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) func didChangeWatchedFiles(params: DidChangeWatchedFilesParams) async throws { - try await withCheckedThrowingContinuation { (continutation: CheckedContinuation) in + try await withCheckedThrowingContinuation { (continuation: CheckedContinuation) in self.didChangeWatchedFiles(params: params) { error in if let error = error { - continutation.resume(throwing: error) + continuation.resume(throwing: error) } else { - continutation.resume() + continuation.resume() } } } } - func callHeirarchyIncomingCalls(params: CallHierarchyIncomingCallsParams, block: @escaping (ServerResult) -> Void) { - sendRequest(.callHeirarchyIncomingCalls(params), completionHandler: block) + func callHierarchyIncomingCalls(params: CallHierarchyIncomingCallsParams, block: @escaping (ServerResult) -> Void) { + sendRequest(.callHierarchyIncomingCalls(params), completionHandler: block) } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) func completion(params: CallHierarchyIncomingCallsParams) async throws -> CallHierarchyIncomingCallsResponse { - try await withCheckedThrowingContinuation { continutation in - self.callHeirarchyIncomingCalls(params: params) { result in - continutation.resume(with: result) + try await withCheckedThrowingContinuation { continuation in + self.callHierarchyIncomingCalls(params: params) { result in + continuation.resume(with: result) } } } - func callHeirarchyOutgoingCalls(params: CallHierarchyOutgoingCallsParams, block: @escaping (ServerResult) -> Void) { - sendRequest(.callHeirarchyOutgoingCalls(params), completionHandler: block) + func callHierarchyOutgoingCalls(params: CallHierarchyOutgoingCallsParams, block: @escaping (ServerResult) -> Void) { + sendRequest(.callHierarchyOutgoingCalls(params), completionHandler: block) } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - func callHeirarchyOutgoingCalls(params: CallHierarchyOutgoingCallsParams) async throws -> CallHierarchyOutgoingCallsResponse { - try await withCheckedThrowingContinuation { continutation in - self.callHeirarchyOutgoingCalls(params: params) { result in - continutation.resume(with: result) + func callHierarchyOutgoingCalls(params: CallHierarchyOutgoingCallsParams) async throws -> CallHierarchyOutgoingCallsResponse { + try await withCheckedThrowingContinuation { continuation in + self.callHierarchyOutgoingCalls(params: params) { result in + continuation.resume(with: result) } } } @@ -293,9 +293,9 @@ public extension Server { @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) func completion(params: CompletionParams) async throws -> CompletionResponse { - try await withCheckedThrowingContinuation { continutation in + try await withCheckedThrowingContinuation { continuation in self.completion(params: params) { result in - continutation.resume(with: result) + continuation.resume(with: result) } } } @@ -306,9 +306,9 @@ public extension Server { @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) func hover(params: TextDocumentPositionParams) async throws -> HoverResponse { - try await withCheckedThrowingContinuation { continutation in + try await withCheckedThrowingContinuation { continuation in self.hover(params: params) { result in - continutation.resume(with: result) + continuation.resume(with: result) } } } @@ -327,9 +327,9 @@ public extension Server { @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) func definition(params: TextDocumentPositionParams) async throws -> DefinitionResponse { - try await withCheckedThrowingContinuation { continutation in + try await withCheckedThrowingContinuation { continuation in self.definition(params: params) { result in - continutation.resume(with: result) + continuation.resume(with: result) } } } @@ -352,22 +352,22 @@ public extension Server { @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) func codeAction(params: CodeActionParams) async throws -> CodeActionResponse { - try await withCheckedThrowingContinuation { continutation in + try await withCheckedThrowingContinuation { continuation in codeAction(params: params) { result in - continutation.resume(with: result) + continuation.resume(with: result) } } } - func prepareCallHeirarchy(params: CallHierarchyPrepareParams, block: @escaping (ServerResult) -> Void) { - sendRequest(.prepareCallHeirarchy(params), completionHandler: block) + func prepareCallHierarchy(params: CallHierarchyPrepareParams, block: @escaping (ServerResult) -> Void) { + sendRequest(.prepareCallHierarchy(params), completionHandler: block) } @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) - func prepareCallHeirarchy(params: CallHierarchyPrepareParams) async throws -> CallHierarchyPrepareResponse { - try await withCheckedThrowingContinuation { continutation in - prepareCallHeirarchy(params: params) { result in - continutation.resume(with: result) + func prepareCallHierarchy(params: CallHierarchyPrepareParams) async throws -> CallHierarchyPrepareResponse { + try await withCheckedThrowingContinuation { continuation in + prepareCallHierarchy(params: params) { result in + continuation.resume(with: result) } } } @@ -386,9 +386,9 @@ public extension Server { @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) func formatting(params: DocumentFormattingParams) async throws -> FormattingResult { - try await withCheckedThrowingContinuation { continutation in + try await withCheckedThrowingContinuation { continuation in self.formatting(params: params) { result in - continutation.resume(with: result) + continuation.resume(with: result) } } } @@ -415,9 +415,9 @@ public extension Server { @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) func semanticTokensFull(params: SemanticTokensParams) async throws -> SemanticTokensResponse { - try await withCheckedThrowingContinuation { continutation in + try await withCheckedThrowingContinuation { continuation in self.semanticTokensFull(params: params) { result in - continutation.resume(with: result) + continuation.resume(with: result) } } } @@ -428,9 +428,9 @@ public extension Server { @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) func semanticTokensFullDelta(params: SemanticTokensDeltaParams) async throws -> SemanticTokensDeltaResponse { - try await withCheckedThrowingContinuation { continutation in + try await withCheckedThrowingContinuation { continuation in self.semanticTokensFullDelta(params: params) { result in - continutation.resume(with: result) + continuation.resume(with: result) } } } @@ -441,9 +441,9 @@ public extension Server { @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) func semanticTokensRange(params: SemanticTokensRangeParams) async throws -> SemanticTokensResponse { - try await withCheckedThrowingContinuation { continutation in + try await withCheckedThrowingContinuation { continuation in self.semanticTokensRange(params: params) { result in - continutation.resume(with: result) + continuation.resume(with: result) } } } @@ -500,9 +500,9 @@ public extension Server { @available(macOS 10.15, iOS 13.0, watchOS 6.0, tvOS 13.0, *) func workspaceSymbol(params: WorkspaceSymbolParams) async throws -> WorkspaceSymbolResponse { - try await withCheckedThrowingContinuation { continutation in + try await withCheckedThrowingContinuation { continuation in self.workspaceSymbol(params: params) { result in - continutation.resume(with: result) + continuation.resume(with: result) } } }