mirror of
https://github.com/apple/sourcekit-lsp.git
synced 2026-10-14 22:49:07 +02:00
This should be a last stop-gap measure in case sourcekitd or clangd get stuck, don’t respond to any requests anymore and don’t honor cancellation either. In that case we can restore SourceKit-LSP behavior by killing them and using the crash recovery logic to restore functionality. rdar://149492159
30 lines
1006 B
Swift
30 lines
1006 B
Swift
//===----------------------------------------------------------------------===//
|
|
//
|
|
// This source file is part of the Swift.org open source project
|
|
//
|
|
// Copyright (c) 2014 - 2025 Apple Inc. and the Swift project authors
|
|
// Licensed under Apache License v2.0 with Runtime Library Exception
|
|
//
|
|
// See https://swift.org/LICENSE.txt for license information
|
|
// See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
package import SourceKitD
|
|
|
|
extension SourceKitD {
|
|
/// Convenience overload of the `send` function for testing that doesn't restart sourcekitd if it does not respond
|
|
/// and doesn't pass any file contents.
|
|
package func send(
|
|
_ request: SKDRequestDictionary,
|
|
timeout: Duration
|
|
) async throws -> SKDResponseDictionary {
|
|
return try await self.send(
|
|
request,
|
|
timeout: timeout,
|
|
restartTimeout: .seconds(60 * 60 * 24),
|
|
fileContents: nil
|
|
)
|
|
}
|
|
}
|