File tree Expand file tree Collapse file tree 2 files changed +27
-0
lines changed
Sources/LanguageServerProtocolTransport Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change 11add_library (LanguageServerProtocolTransport
22 BuildServerMessageDependencyTracker.swift
3+ Connection+Send.swift
34 DisableSigpipe.swift
45 DocumentURI+CustomLogStringConvertible.swift
56 JSONRPCConnection.swift
Original file line number Diff line number Diff line change 1+ //===----------------------------------------------------------------------===//
2+ //
3+ // This source file is part of the Swift.org open source project
4+ //
5+ // Copyright (c) 2025 Apple Inc. and the Swift project authors
6+ // Licensed under Apache License v2.0 with Runtime Library Exception
7+ //
8+ // See https://swift.org/LICENSE.txt for license information
9+ // See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
10+ //
11+ //===----------------------------------------------------------------------===//
12+
13+ public import LanguageServerProtocol
14+ @_spi ( SourceKitLSP) private import ToolsProtocolsSwiftExtensions
15+
16+ extension Connection {
17+ public func send< R: RequestType > ( _ request: R ) async throws -> R . Response {
18+ return try await withCancellableCheckedThrowingContinuation { continuation in
19+ return self . send ( request) { result in
20+ continuation. resume ( with: result)
21+ }
22+ } cancel: { requestID in
23+ self . send ( CancelRequestNotification ( id: requestID) )
24+ }
25+ }
26+ }
You can’t perform that action at this time.
0 commit comments