mirror of
https://github.com/apple/sourcekit-lsp.git
synced 2026-03-02 18:23:24 +01:00
Merge pull request #2044 from ahoppen/require-swift-6
Require Swift 6 to build SourceKit-LSP
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
// swift-tools-version: 5.10
|
||||
// swift-tools-version: 6.0
|
||||
|
||||
import Foundation
|
||||
import PackageDescription
|
||||
@@ -699,9 +699,10 @@ let package = Package(
|
||||
products: products,
|
||||
dependencies: dependencies,
|
||||
targets: targets,
|
||||
swiftLanguageVersions: [.v5, .version("6")]
|
||||
swiftLanguageModes: [.v6]
|
||||
)
|
||||
|
||||
@MainActor
|
||||
func swiftSyntaxDependencies(_ names: [String]) -> [Target.Dependency] {
|
||||
if buildDynamicSwiftSyntaxLibrary {
|
||||
return [.product(name: "_SwiftSyntaxDynamic", package: "swift-syntax")]
|
||||
@@ -710,6 +711,7 @@ func swiftSyntaxDependencies(_ names: [String]) -> [Target.Dependency] {
|
||||
}
|
||||
}
|
||||
|
||||
@MainActor
|
||||
func swiftPMDependency<T>(_ values: [T]) -> [T] {
|
||||
if noSwiftPMDependency {
|
||||
return []
|
||||
|
||||
@@ -10,11 +10,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if compiler(>=6)
|
||||
public import LanguageServerProtocol
|
||||
#else
|
||||
import LanguageServerProtocol
|
||||
#endif
|
||||
|
||||
fileprivate let requestTypes: [_RequestType.Type] = [
|
||||
BuildShutdownRequest.self,
|
||||
|
||||
@@ -10,11 +10,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if compiler(>=6)
|
||||
public import LanguageServerProtocol
|
||||
#else
|
||||
import LanguageServerProtocol
|
||||
#endif
|
||||
|
||||
/// Like the language server protocol, the shutdown build request is
|
||||
/// sent from the client to the server. It asks the server to shut down,
|
||||
|
||||
@@ -10,11 +10,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if compiler(>=6)
|
||||
public import LanguageServerProtocol
|
||||
#else
|
||||
import LanguageServerProtocol
|
||||
#endif
|
||||
|
||||
/// For all the source files in this target, the output paths that are used during indexing, ie. the
|
||||
/// `-index-unit-output-path` for the file, if it is specified in the compiler arguments or the file that is passed as
|
||||
|
||||
@@ -10,11 +10,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if compiler(>=6)
|
||||
public import LanguageServerProtocol
|
||||
#else
|
||||
import LanguageServerProtocol
|
||||
#endif
|
||||
|
||||
public typealias OriginId = String
|
||||
|
||||
|
||||
@@ -10,11 +10,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if compiler(>=6)
|
||||
public import LanguageServerProtocol
|
||||
#else
|
||||
import LanguageServerProtocol
|
||||
#endif
|
||||
|
||||
/// The build target sources request is sent from the client to the server to
|
||||
/// query for the list of text documents and directories that belong to a
|
||||
|
||||
@@ -10,11 +10,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if compiler(>=6)
|
||||
public import LanguageServerProtocol
|
||||
#else
|
||||
import LanguageServerProtocol
|
||||
#endif
|
||||
|
||||
/// Like the language server protocol, the initialize request is sent
|
||||
/// as the first request from the client to the server. If the server
|
||||
|
||||
@@ -10,11 +10,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if compiler(>=6)
|
||||
public import LanguageServerProtocol
|
||||
#else
|
||||
import LanguageServerProtocol
|
||||
#endif
|
||||
|
||||
/// Like the language server protocol, a notification to ask the
|
||||
/// server to exit its process. The server should exit with success
|
||||
|
||||
@@ -10,11 +10,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if compiler(>=6)
|
||||
public import LanguageServerProtocol
|
||||
#else
|
||||
import LanguageServerProtocol
|
||||
#endif
|
||||
|
||||
/// Like the language server protocol, the initialized notification is sent from the client to the server after the client received the result of the initialize request but before the client is sending any other request or notification to the server. The server can use the initialized notification for example to initialize intensive computation such as dependency resolution or compilation. The initialized notification may only be sent once.
|
||||
public struct OnBuildInitializedNotification: NotificationType {
|
||||
|
||||
@@ -10,11 +10,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if compiler(>=6)
|
||||
public import LanguageServerProtocol
|
||||
#else
|
||||
import LanguageServerProtocol
|
||||
#endif
|
||||
|
||||
/// The log message notification is sent from a server to a client to ask the client to log a particular message in its console.
|
||||
///
|
||||
|
||||
@@ -10,11 +10,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if compiler(>=6)
|
||||
public import LanguageServerProtocol
|
||||
#else
|
||||
import LanguageServerProtocol
|
||||
#endif
|
||||
|
||||
/// The build target changed notification is sent from the server to the client
|
||||
/// to signal a change in a build target. The server communicates during the
|
||||
|
||||
@@ -10,11 +10,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if compiler(>=6)
|
||||
public import LanguageServerProtocol
|
||||
#else
|
||||
import LanguageServerProtocol
|
||||
#endif
|
||||
|
||||
/// Notification sent from SourceKit-LSP to the build system to indicate that files within the project have been modified.
|
||||
public typealias OnWatchedFilesDidChangeNotification = LanguageServerProtocol.DidChangeWatchedFilesNotification
|
||||
|
||||
@@ -10,11 +10,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if compiler(>=6)
|
||||
public import LanguageServerProtocol
|
||||
#else
|
||||
import LanguageServerProtocol
|
||||
#endif
|
||||
|
||||
/// The register for changes request is sent from the language
|
||||
/// server to the build server to register or unregister for
|
||||
|
||||
@@ -10,13 +10,8 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if compiler(>=6)
|
||||
public import LanguageServerProtocol
|
||||
public import Foundation
|
||||
#else
|
||||
import LanguageServerProtocol
|
||||
import Foundation
|
||||
#endif
|
||||
public import LanguageServerProtocol
|
||||
|
||||
/// A `build/taskFinish` notification must always be sent after a `build/taskStart`` with the same `taskId` was sent.
|
||||
public struct TaskFinishNotification: NotificationType {
|
||||
|
||||
@@ -10,13 +10,8 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if compiler(>=6)
|
||||
public import LanguageServerProtocol
|
||||
public import Foundation
|
||||
#else
|
||||
import LanguageServerProtocol
|
||||
import Foundation
|
||||
#endif
|
||||
public import LanguageServerProtocol
|
||||
|
||||
/// After a `taskStart` and before `taskFinish` for a `taskId`, the server may send any number of progress
|
||||
/// notifications.
|
||||
|
||||
@@ -10,13 +10,8 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if compiler(>=6)
|
||||
public import LanguageServerProtocol
|
||||
public import Foundation
|
||||
#else
|
||||
import LanguageServerProtocol
|
||||
import Foundation
|
||||
#endif
|
||||
public import LanguageServerProtocol
|
||||
|
||||
/// The BSP server can inform the client on the execution state of any task in the build tool.
|
||||
/// The execution of some tasks, such as compilation or tests, must always be reported by the server.
|
||||
|
||||
@@ -10,11 +10,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if compiler(>=6)
|
||||
public import LanguageServerProtocol
|
||||
#else
|
||||
import LanguageServerProtocol
|
||||
#endif
|
||||
|
||||
/// The `TextDocumentSourceKitOptionsRequest` request is sent from the client to the server to query for the list of
|
||||
/// compiler options necessary to compile this file in the given target.
|
||||
|
||||
@@ -10,11 +10,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if compiler(>=6)
|
||||
public import LanguageServerProtocol
|
||||
#else
|
||||
import LanguageServerProtocol
|
||||
#endif
|
||||
|
||||
/// The workspace build targets request is sent from the client to the server to
|
||||
/// ask for the list of all available build targets in the workspace.
|
||||
|
||||
@@ -10,11 +10,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if compiler(>=6)
|
||||
public import LanguageServerProtocol
|
||||
#else
|
||||
import LanguageServerProtocol
|
||||
#endif
|
||||
|
||||
/// This request is a no-op and doesn't have any effects.
|
||||
///
|
||||
|
||||
@@ -10,11 +10,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if compiler(>=6)
|
||||
public import LanguageServerProtocol
|
||||
#else
|
||||
import LanguageServerProtocol
|
||||
#endif
|
||||
|
||||
/// Build target contains metadata about an artifact (for example library, test, or binary artifact).
|
||||
/// Using vocabulary of other build tools:
|
||||
|
||||
@@ -10,13 +10,8 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if compiler(>=6)
|
||||
public import LanguageServerProtocol
|
||||
public import Foundation
|
||||
#else
|
||||
import LanguageServerProtocol
|
||||
import Foundation
|
||||
#endif
|
||||
public import LanguageServerProtocol
|
||||
|
||||
public struct MillisecondsSince1970Date: CustomCodableWrapper {
|
||||
public var wrappedValue: Date
|
||||
|
||||
@@ -10,13 +10,8 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if compiler(>=6)
|
||||
package import LanguageServerProtocol
|
||||
package import SKLogging
|
||||
#else
|
||||
import LanguageServerProtocol
|
||||
import SKLogging
|
||||
#endif
|
||||
|
||||
// MARK: - Build settings logger
|
||||
|
||||
|
||||
@@ -10,13 +10,8 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if compiler(>=6)
|
||||
package import LanguageServerProtocol
|
||||
package import Foundation
|
||||
#else
|
||||
import LanguageServerProtocol
|
||||
import Foundation
|
||||
#endif
|
||||
package import LanguageServerProtocol
|
||||
|
||||
package struct SwiftPMTestHooks: Sendable {
|
||||
package var reloadPackageDidStart: (@Sendable () async -> Void)?
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if compiler(>=6)
|
||||
package import BuildServerProtocol
|
||||
import Dispatch
|
||||
package import Foundation
|
||||
@@ -20,25 +19,10 @@ import SKLogging
|
||||
package import SKOptions
|
||||
import SKUtilities
|
||||
package import SwiftExtensions
|
||||
import TSCExtensions
|
||||
package import ToolchainRegistry
|
||||
import TSCExtensions
|
||||
|
||||
import struct TSCBasic.RelativePath
|
||||
#else
|
||||
import BuildServerProtocol
|
||||
import Dispatch
|
||||
import Foundation
|
||||
import LanguageServerProtocol
|
||||
import LanguageServerProtocolExtensions
|
||||
import SKLogging
|
||||
import SKOptions
|
||||
import SKUtilities
|
||||
import SwiftExtensions
|
||||
import ToolchainRegistry
|
||||
import TSCExtensions
|
||||
|
||||
import struct TSCBasic.RelativePath
|
||||
#endif
|
||||
|
||||
fileprivate typealias RequestCache<Request: RequestType & Hashable> = Cache<Request, Request.Response>
|
||||
|
||||
|
||||
@@ -10,13 +10,8 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if compiler(>=6)
|
||||
package import BuildServerProtocol
|
||||
package import LanguageServerProtocol
|
||||
#else
|
||||
import BuildServerProtocol
|
||||
import LanguageServerProtocol
|
||||
#endif
|
||||
|
||||
/// Handles build system events, such as file build settings changes.
|
||||
package protocol BuildSystemManagerDelegate: AnyObject, Sendable {
|
||||
|
||||
@@ -10,19 +10,11 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if compiler(>=6)
|
||||
import BuildServerProtocol
|
||||
package import LanguageServerProtocol
|
||||
import LanguageServerProtocolExtensions
|
||||
import SKLogging
|
||||
package import SwiftExtensions
|
||||
#else
|
||||
import BuildServerProtocol
|
||||
import LanguageServerProtocol
|
||||
import LanguageServerProtocolExtensions
|
||||
import SKLogging
|
||||
import SwiftExtensions
|
||||
#endif
|
||||
|
||||
/// A lightweight way of describing tasks that are created from handling BSP
|
||||
/// requests or notifications for the purpose of dependency tracking.
|
||||
|
||||
@@ -10,16 +10,11 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
package import BuildServerProtocol
|
||||
import Foundation
|
||||
import LanguageServerProtocol
|
||||
import SKLogging
|
||||
|
||||
#if compiler(>=6)
|
||||
package import BuildServerProtocol
|
||||
#else
|
||||
import BuildServerProtocol
|
||||
#endif
|
||||
|
||||
extension BuildTargetIdentifier {
|
||||
package static let dummy: BuildTargetIdentifier = BuildTargetIdentifier(uri: try! URI(string: "dummy://dummy"))
|
||||
}
|
||||
@@ -152,7 +147,6 @@ extension BuildTargetIdentifier {
|
||||
}
|
||||
}
|
||||
|
||||
#if compiler(>=6)
|
||||
extension BuildTargetIdentifier: CustomLogStringConvertible {
|
||||
package var description: String {
|
||||
return uri.stringValue
|
||||
@@ -162,14 +156,3 @@ extension BuildTargetIdentifier: CustomLogStringConvertible {
|
||||
return uri.stringValue.hashForLogging
|
||||
}
|
||||
}
|
||||
#else
|
||||
extension BuildTargetIdentifier: CustomLogStringConvertible {
|
||||
public var description: String {
|
||||
return uri.stringValue
|
||||
}
|
||||
|
||||
public var redactedDescription: String {
|
||||
return uri.stringValue.hashForLogging
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -10,21 +10,12 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if compiler(>=6)
|
||||
package import BuildServerProtocol
|
||||
package import Foundation
|
||||
package import LanguageServerProtocol
|
||||
import SKLogging
|
||||
import SKOptions
|
||||
import ToolchainRegistry
|
||||
#else
|
||||
import BuildServerProtocol
|
||||
import Foundation
|
||||
import LanguageServerProtocol
|
||||
import SKLogging
|
||||
import SKOptions
|
||||
import ToolchainRegistry
|
||||
#endif
|
||||
|
||||
/// An error build systems can throw from `prepare` if they don't support preparation of targets.
|
||||
package struct PrepareNotSupportedError: Error, CustomStringConvertible {
|
||||
|
||||
@@ -11,20 +11,14 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
import BuildServerProtocol
|
||||
package import Foundation
|
||||
package import LanguageServerProtocol
|
||||
import LanguageServerProtocolExtensions
|
||||
import SKLogging
|
||||
import SKOptions
|
||||
import SwiftExtensions
|
||||
import ToolchainRegistry
|
||||
|
||||
#if compiler(>=6)
|
||||
package import Foundation
|
||||
package import LanguageServerProtocol
|
||||
#else
|
||||
import Foundation
|
||||
import LanguageServerProtocol
|
||||
#endif
|
||||
|
||||
/// The details necessary to create a `BuildSystemAdapter`.
|
||||
package struct BuildSystemSpec {
|
||||
package enum Kind {
|
||||
|
||||
@@ -10,21 +10,12 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if compiler(>=6)
|
||||
package import Foundation
|
||||
package import LanguageServerProtocol
|
||||
import LanguageServerProtocolExtensions
|
||||
import SKLogging
|
||||
import SwiftExtensions
|
||||
import TSCExtensions
|
||||
#else
|
||||
import Foundation
|
||||
import LanguageServerProtocol
|
||||
import LanguageServerProtocolExtensions
|
||||
import SKLogging
|
||||
import SwiftExtensions
|
||||
import TSCExtensions
|
||||
#endif
|
||||
|
||||
#if os(Windows)
|
||||
import WinSDK
|
||||
|
||||
@@ -11,7 +11,9 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
import Foundation
|
||||
package import LanguageServerProtocol
|
||||
import SKLogging
|
||||
package import SKOptions
|
||||
import SwiftExtensions
|
||||
import TSCExtensions
|
||||
import ToolchainRegistry
|
||||
@@ -19,14 +21,6 @@ import ToolchainRegistry
|
||||
import struct TSCBasic.AbsolutePath
|
||||
import struct TSCBasic.RelativePath
|
||||
|
||||
#if compiler(>=6)
|
||||
package import LanguageServerProtocol
|
||||
package import SKOptions
|
||||
#else
|
||||
import LanguageServerProtocol
|
||||
import SKOptions
|
||||
#endif
|
||||
|
||||
private func searchForCompilationDatabaseConfig(
|
||||
in workspaceFolder: URL,
|
||||
options: SourceKitLSPOptions
|
||||
|
||||
@@ -11,21 +11,15 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
import Foundation
|
||||
package import LanguageServerProtocol
|
||||
import LanguageServerProtocolExtensions
|
||||
package import SKOptions
|
||||
import SwiftExtensions
|
||||
import TSCExtensions
|
||||
|
||||
import struct TSCBasic.AbsolutePath
|
||||
import class TSCBasic.Process
|
||||
|
||||
#if compiler(>=6)
|
||||
package import LanguageServerProtocol
|
||||
package import SKOptions
|
||||
#else
|
||||
import LanguageServerProtocol
|
||||
import SKOptions
|
||||
#endif
|
||||
|
||||
/// The path to the SDK.
|
||||
private let sdkpath: AbsolutePath? = {
|
||||
guard Platform.current == .darwin else { return nil }
|
||||
|
||||
@@ -11,13 +11,8 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
import Foundation
|
||||
import LanguageServerProtocolExtensions
|
||||
|
||||
#if compiler(>=6)
|
||||
package import LanguageServerProtocol
|
||||
#else
|
||||
import LanguageServerProtocol
|
||||
#endif
|
||||
import LanguageServerProtocolExtensions
|
||||
|
||||
/// Build settings for a single file.
|
||||
///
|
||||
|
||||
@@ -10,18 +10,11 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
import SKLogging
|
||||
import SwiftExtensions
|
||||
|
||||
#if compiler(>=6)
|
||||
package import BuildServerProtocol
|
||||
package import Foundation
|
||||
package import LanguageServerProtocol
|
||||
#else
|
||||
import BuildServerProtocol
|
||||
import Foundation
|
||||
import LanguageServerProtocol
|
||||
#endif
|
||||
import SKLogging
|
||||
import SwiftExtensions
|
||||
|
||||
func lastIndexStorePathArgument(in compilerArgs: [String]) -> String? {
|
||||
if let indexStorePathIndex = compilerArgs.lastIndex(of: "-index-store-path"),
|
||||
|
||||
@@ -10,20 +10,12 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
import SKLogging
|
||||
import SwiftExtensions
|
||||
|
||||
#if compiler(>=6)
|
||||
package import BuildServerProtocol
|
||||
package import Foundation
|
||||
package import LanguageServerProtocol
|
||||
import SKLogging
|
||||
import SwiftExtensions
|
||||
package import ToolchainRegistry
|
||||
#else
|
||||
import BuildServerProtocol
|
||||
import Foundation
|
||||
import LanguageServerProtocol
|
||||
import ToolchainRegistry
|
||||
#endif
|
||||
|
||||
fileprivate extension CompilationDatabaseCompileCommand {
|
||||
/// The first entry in the command line identifies the compiler that should be used to compile the file and can thus
|
||||
|
||||
@@ -10,11 +10,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if compiler(>=6)
|
||||
package import LanguageServerProtocol
|
||||
#else
|
||||
import LanguageServerProtocol
|
||||
#endif
|
||||
|
||||
/// A type that can provide the set of main files that include a particular file.
|
||||
package protocol MainFilesProvider: Sendable {
|
||||
|
||||
@@ -13,38 +13,27 @@
|
||||
#if !NO_SWIFTPM_DEPENDENCY
|
||||
import Basics
|
||||
@preconcurrency import Build
|
||||
package import BuildServerProtocol
|
||||
import Dispatch
|
||||
package import Foundation
|
||||
package import LanguageServerProtocol
|
||||
import LanguageServerProtocolExtensions
|
||||
@preconcurrency import PackageGraph
|
||||
import PackageLoading
|
||||
import PackageModel
|
||||
import SKLogging
|
||||
package import SKOptions
|
||||
@preconcurrency package import SPMBuildCore
|
||||
import SourceControl
|
||||
@preconcurrency package import SourceKitLSPAPI
|
||||
import SwiftExtensions
|
||||
import TSCExtensions
|
||||
package import ToolchainRegistry
|
||||
@preconcurrency import Workspace
|
||||
|
||||
import struct TSCBasic.AbsolutePath
|
||||
import class TSCBasic.Process
|
||||
|
||||
#if compiler(>=6)
|
||||
package import BuildServerProtocol
|
||||
package import Foundation
|
||||
package import LanguageServerProtocol
|
||||
package import SKOptions
|
||||
@preconcurrency package import SourceKitLSPAPI
|
||||
package import ToolchainRegistry
|
||||
package import class ToolchainRegistry.Toolchain
|
||||
#else
|
||||
import BuildServerProtocol
|
||||
import Foundation
|
||||
import LanguageServerProtocol
|
||||
import SKOptions
|
||||
@preconcurrency import SourceKitLSPAPI
|
||||
import ToolchainRegistry
|
||||
import class ToolchainRegistry.Toolchain
|
||||
#endif
|
||||
|
||||
fileprivate typealias AbsolutePath = Basics.AbsolutePath
|
||||
|
||||
|
||||
@@ -10,16 +10,11 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
package import CompletionScoring
|
||||
import Foundation
|
||||
import SwiftExtensions
|
||||
import XCTest
|
||||
|
||||
#if compiler(>=6)
|
||||
package import CompletionScoring
|
||||
#else
|
||||
import CompletionScoring
|
||||
#endif
|
||||
|
||||
@inline(never)
|
||||
package func drain<T>(_ value: T) {}
|
||||
|
||||
|
||||
@@ -10,11 +10,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if compiler(>=6)
|
||||
package import ArgumentParser
|
||||
#else
|
||||
import ArgumentParser
|
||||
#endif
|
||||
|
||||
package struct DebugCommand: ParsableCommand {
|
||||
package static let configuration = CommandConfiguration(
|
||||
|
||||
@@ -10,29 +10,16 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if compiler(>=6)
|
||||
package import ArgumentParser
|
||||
import Foundation
|
||||
import LanguageServerProtocolExtensions
|
||||
import ToolchainRegistry
|
||||
import SwiftExtensions
|
||||
import TSCExtensions
|
||||
import ToolchainRegistry
|
||||
|
||||
import struct TSCBasic.AbsolutePath
|
||||
import class TSCBasic.Process
|
||||
import class TSCUtility.PercentProgressAnimation
|
||||
#else
|
||||
import ArgumentParser
|
||||
import Foundation
|
||||
import LanguageServerProtocolExtensions
|
||||
import ToolchainRegistry
|
||||
import SwiftExtensions
|
||||
import TSCExtensions
|
||||
|
||||
import struct TSCBasic.AbsolutePath
|
||||
import class TSCBasic.Process
|
||||
import class TSCUtility.PercentProgressAnimation
|
||||
#endif
|
||||
|
||||
/// When diagnosis is started, a progress bar displayed on the terminal that shows how far the diagnose command has
|
||||
/// progressed.
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if compiler(>=6)
|
||||
public import ArgumentParser
|
||||
import Foundation
|
||||
import InProcessClient
|
||||
@@ -24,21 +23,6 @@ import ToolchainRegistry
|
||||
import struct TSCBasic.AbsolutePath
|
||||
import class TSCBasic.Process
|
||||
import class TSCUtility.PercentProgressAnimation
|
||||
#else
|
||||
import ArgumentParser
|
||||
import Foundation
|
||||
import InProcessClient
|
||||
import LanguageServerProtocol
|
||||
import LanguageServerProtocolExtensions
|
||||
import SKOptions
|
||||
import SourceKitLSP
|
||||
import SwiftExtensions
|
||||
import ToolchainRegistry
|
||||
|
||||
import struct TSCBasic.AbsolutePath
|
||||
import class TSCBasic.Process
|
||||
import class TSCUtility.PercentProgressAnimation
|
||||
#endif
|
||||
|
||||
private actor IndexLogMessageHandler: MessageHandler {
|
||||
var hasSeenError: Bool = false
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if compiler(>=6)
|
||||
package import ArgumentParser
|
||||
import Foundation
|
||||
import ToolchainRegistry
|
||||
@@ -18,15 +17,6 @@ import ToolchainRegistry
|
||||
import struct TSCBasic.AbsolutePath
|
||||
import class TSCBasic.Process
|
||||
import class TSCUtility.PercentProgressAnimation
|
||||
#else
|
||||
import ArgumentParser
|
||||
import Foundation
|
||||
import ToolchainRegistry
|
||||
|
||||
import struct TSCBasic.AbsolutePath
|
||||
import class TSCBasic.Process
|
||||
import class TSCUtility.PercentProgressAnimation
|
||||
#endif
|
||||
|
||||
package struct ReduceCommand: AsyncParsableCommand {
|
||||
package static let configuration: CommandConfiguration = CommandConfiguration(
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if compiler(>=6)
|
||||
package import ArgumentParser
|
||||
import Foundation
|
||||
import ToolchainRegistry
|
||||
@@ -18,15 +17,6 @@ import ToolchainRegistry
|
||||
import struct TSCBasic.AbsolutePath
|
||||
import class TSCBasic.Process
|
||||
import class TSCUtility.PercentProgressAnimation
|
||||
#else
|
||||
import ArgumentParser
|
||||
import Foundation
|
||||
import ToolchainRegistry
|
||||
|
||||
import struct TSCBasic.AbsolutePath
|
||||
import class TSCBasic.Process
|
||||
import class TSCUtility.PercentProgressAnimation
|
||||
#endif
|
||||
|
||||
package struct ReduceFrontendCommand: AsyncParsableCommand {
|
||||
package static let configuration: CommandConfiguration = CommandConfiguration(
|
||||
|
||||
@@ -10,15 +10,9 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if compiler(>=6)
|
||||
package import Foundation
|
||||
import RegexBuilder
|
||||
import SwiftExtensions
|
||||
#else
|
||||
import Foundation
|
||||
import RegexBuilder
|
||||
import SwiftExtensions
|
||||
#endif
|
||||
|
||||
/// All the information necessary to replay a sourcektid request.
|
||||
package struct RequestInfo: Sendable {
|
||||
|
||||
@@ -10,27 +10,15 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if compiler(>=6)
|
||||
package import ArgumentParser
|
||||
import Csourcekitd
|
||||
import Foundation
|
||||
import SKUtilities
|
||||
import SwiftExtensions
|
||||
import SourceKitD
|
||||
import ToolchainRegistry
|
||||
|
||||
import struct TSCBasic.AbsolutePath
|
||||
#else
|
||||
import ArgumentParser
|
||||
import Csourcekitd
|
||||
import Foundation
|
||||
import SKUtilities
|
||||
import SourceKitD
|
||||
import SwiftExtensions
|
||||
import ToolchainRegistry
|
||||
|
||||
import struct TSCBasic.AbsolutePath
|
||||
#endif
|
||||
|
||||
package struct RunSourceKitdRequestCommand: AsyncParsableCommand {
|
||||
package static let configuration = CommandConfiguration(
|
||||
|
||||
@@ -10,15 +10,9 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if compiler(>=6)
|
||||
import Csourcekitd
|
||||
import Foundation
|
||||
package import SourceKitD
|
||||
#else
|
||||
import Csourcekitd
|
||||
import Foundation
|
||||
import SourceKitD
|
||||
#endif
|
||||
|
||||
extension SourceKitD {
|
||||
/// Parse the request from YAML and execute it.
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if compiler(>=6)
|
||||
package import Foundation
|
||||
import SourceKitD
|
||||
import SwiftExtensions
|
||||
@@ -18,15 +17,6 @@ import SwiftExtensions
|
||||
import struct TSCBasic.AbsolutePath
|
||||
import class TSCBasic.Process
|
||||
import struct TSCBasic.ProcessResult
|
||||
#else
|
||||
import Foundation
|
||||
import SourceKitD
|
||||
import SwiftExtensions
|
||||
|
||||
import struct TSCBasic.AbsolutePath
|
||||
import class TSCBasic.Process
|
||||
import struct TSCBasic.ProcessResult
|
||||
#endif
|
||||
|
||||
/// The different states in which a sourcekitd request can finish.
|
||||
package enum SourceKitDRequestResult: Sendable {
|
||||
|
||||
@@ -10,17 +10,10 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if compiler(>=6)
|
||||
package import Foundation
|
||||
import ToolchainRegistry
|
||||
|
||||
import struct TSCBasic.AbsolutePath
|
||||
#else
|
||||
import Foundation
|
||||
import ToolchainRegistry
|
||||
|
||||
import struct TSCBasic.AbsolutePath
|
||||
#endif
|
||||
|
||||
extension Toolchain {
|
||||
/// The path to `swift-frontend` in the toolchain, found relative to `swift`.
|
||||
|
||||
@@ -10,21 +10,12 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if compiler(>=6)
|
||||
package import ArgumentParser
|
||||
import Foundation
|
||||
import RegexBuilder
|
||||
import SwiftExtensions
|
||||
|
||||
import class TSCBasic.Process
|
||||
#else
|
||||
import ArgumentParser
|
||||
import Foundation
|
||||
import RegexBuilder
|
||||
import SwiftExtensions
|
||||
|
||||
import class TSCBasic.Process
|
||||
#endif
|
||||
|
||||
/// Shared instance of the regex that is used to extract Signpost lines from `log stream --signpost`.
|
||||
fileprivate struct LogParseRegex {
|
||||
|
||||
@@ -15,20 +15,13 @@ public import Foundation
|
||||
public import LanguageServerProtocol
|
||||
import LanguageServerProtocolExtensions
|
||||
import SKLogging
|
||||
import SwiftExtensions
|
||||
import TSCExtensions
|
||||
|
||||
import struct TSCBasic.AbsolutePath
|
||||
|
||||
#if compiler(>=6)
|
||||
package import SKOptions
|
||||
package import SourceKitLSP
|
||||
import SwiftExtensions
|
||||
import TSCExtensions
|
||||
package import ToolchainRegistry
|
||||
#else
|
||||
import SKOptions
|
||||
import SourceKitLSP
|
||||
import ToolchainRegistry
|
||||
#endif
|
||||
|
||||
import struct TSCBasic.AbsolutePath
|
||||
|
||||
/// Launches a `SourceKitLSPServer` in-process and allows sending messages to it.
|
||||
public final class InProcessSourceKitLSPClient: Sendable {
|
||||
|
||||
@@ -10,11 +10,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if compiler(>=6)
|
||||
public import Foundation
|
||||
#else
|
||||
import Foundation
|
||||
#endif
|
||||
|
||||
struct FailedToConstructDocumentURIFromStringError: Error, CustomStringConvertible {
|
||||
let string: String
|
||||
|
||||
@@ -10,13 +10,8 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if compiler(>=6)
|
||||
package import LanguageServerProtocol
|
||||
import SwiftExtensions
|
||||
#else
|
||||
import LanguageServerProtocol
|
||||
import SwiftExtensions
|
||||
#endif
|
||||
|
||||
extension Connection {
|
||||
/// Send the given request to the connection and await its result.
|
||||
|
||||
@@ -10,15 +10,9 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if compiler(>=6)
|
||||
import Foundation
|
||||
package import LanguageServerProtocol
|
||||
import SwiftExtensions
|
||||
#else
|
||||
import Foundation
|
||||
import LanguageServerProtocol
|
||||
import SwiftExtensions
|
||||
#endif
|
||||
|
||||
extension DocumentURI {
|
||||
/// If this is a file URI pointing to a symlink, return the realpath of the URI, otherwise return `nil`.
|
||||
|
||||
@@ -10,13 +10,8 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if compiler(>=6)
|
||||
import Foundation
|
||||
package import LanguageServerProtocol
|
||||
#else
|
||||
import Foundation
|
||||
import LanguageServerProtocol
|
||||
#endif
|
||||
|
||||
extension Language {
|
||||
package enum SemanticKind {
|
||||
|
||||
@@ -11,16 +11,11 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
import Dispatch
|
||||
package import LanguageServerProtocol
|
||||
import LanguageServerProtocolJSONRPC
|
||||
import SKLogging
|
||||
import SwiftExtensions
|
||||
|
||||
#if compiler(>=6)
|
||||
package import LanguageServerProtocol
|
||||
#else
|
||||
import LanguageServerProtocol
|
||||
#endif
|
||||
|
||||
/// A connection between two message handlers in the same process.
|
||||
///
|
||||
/// You must call `start(handler:)` before sending any messages, and must call `close()` when finished to avoid a memory leak.
|
||||
|
||||
@@ -11,16 +11,10 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
import Foundation
|
||||
package import LanguageServerProtocol
|
||||
import LanguageServerProtocolJSONRPC
|
||||
import SKLogging
|
||||
|
||||
#if compiler(>=6)
|
||||
package import LanguageServerProtocol
|
||||
package import SwiftExtensions
|
||||
#else
|
||||
import LanguageServerProtocol
|
||||
import SwiftExtensions
|
||||
#endif
|
||||
|
||||
/// Side structure in which `QueueBasedMessageHandler` can keep track of active requests etc.
|
||||
///
|
||||
|
||||
@@ -10,13 +10,8 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if compiler(>=6)
|
||||
package import LanguageServerProtocol
|
||||
import SwiftExtensions
|
||||
#else
|
||||
import LanguageServerProtocol
|
||||
import SwiftExtensions
|
||||
#endif
|
||||
|
||||
/// A request and a callback that returns the request's reply
|
||||
package final class RequestAndReply<Params: RequestType>: Sendable {
|
||||
|
||||
@@ -10,17 +10,10 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if compiler(>=6)
|
||||
import Foundation
|
||||
package import LanguageServerProtocol
|
||||
import SKLogging
|
||||
import SwiftExtensions
|
||||
#else
|
||||
import Foundation
|
||||
import LanguageServerProtocol
|
||||
import SKLogging
|
||||
import SwiftExtensions
|
||||
#endif
|
||||
|
||||
/// Represents a single `WorkDoneProgress` task that gets communicated with the client.
|
||||
///
|
||||
|
||||
@@ -10,22 +10,15 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if compiler(>=6)
|
||||
public import Dispatch
|
||||
public import Foundation
|
||||
public import LanguageServerProtocol
|
||||
import SKLogging
|
||||
import SwiftExtensions
|
||||
|
||||
#if canImport(Android)
|
||||
import Android
|
||||
#endif
|
||||
#else
|
||||
import Dispatch
|
||||
import Foundation
|
||||
import LanguageServerProtocol
|
||||
import SKLogging
|
||||
import SwiftExtensions
|
||||
#endif
|
||||
|
||||
#if canImport(CDispatch)
|
||||
import struct CDispatch.dispatch_fd_t
|
||||
|
||||
@@ -10,15 +10,9 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if compiler(>=6)
|
||||
import Foundation
|
||||
package import LanguageServerProtocol
|
||||
package import SKLogging
|
||||
#else
|
||||
import Foundation
|
||||
import LanguageServerProtocol
|
||||
import SKLogging
|
||||
#endif
|
||||
|
||||
// MARK: - RequestType
|
||||
|
||||
|
||||
@@ -10,13 +10,8 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if compiler(>=6)
|
||||
import Foundation
|
||||
public import LanguageServerProtocol
|
||||
#else
|
||||
import Foundation
|
||||
import LanguageServerProtocol
|
||||
#endif
|
||||
|
||||
@_spi(Testing) public enum JSONRPCMessage {
|
||||
case notification(NotificationType)
|
||||
|
||||
@@ -10,11 +10,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if compiler(>=6)
|
||||
package import Foundation
|
||||
#else
|
||||
import Foundation
|
||||
#endif
|
||||
|
||||
#if !NO_CRYPTO_DEPENDENCY
|
||||
import Crypto
|
||||
|
||||
@@ -13,11 +13,7 @@
|
||||
import Foundation
|
||||
|
||||
#if canImport(os) && !SOURCEKIT_LSP_FORCE_NON_DARWIN_LOGGER
|
||||
#if compiler(>=6)
|
||||
@_exported public import os // os_log
|
||||
#else
|
||||
@_exported import os // os_log
|
||||
#endif
|
||||
|
||||
package typealias LogLevel = os.OSLogType
|
||||
package typealias Logger = os.Logger
|
||||
|
||||
@@ -10,11 +10,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if compiler(>=6)
|
||||
package import SwiftExtensions
|
||||
#else
|
||||
import SwiftExtensions
|
||||
#endif
|
||||
|
||||
#if canImport(Darwin)
|
||||
import Foundation
|
||||
|
||||
@@ -14,18 +14,10 @@ import RegexBuilder
|
||||
import SwiftExtensions
|
||||
|
||||
#if canImport(Darwin)
|
||||
#if compiler(>=6)
|
||||
package import Foundation
|
||||
#else
|
||||
import Foundation
|
||||
#endif
|
||||
#else
|
||||
// TODO: @preconcurrency needed because stderr is not sendable on Linux https://github.com/swiftlang/swift/issues/75601
|
||||
#if compiler(>=6)
|
||||
@preconcurrency package import Foundation
|
||||
#else
|
||||
@preconcurrency import Foundation
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if os(Windows)
|
||||
|
||||
@@ -10,21 +10,12 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if compiler(>=6)
|
||||
public import Foundation
|
||||
public import LanguageServerProtocol
|
||||
import LanguageServerProtocolExtensions
|
||||
import SKLogging
|
||||
|
||||
import struct TSCBasic.AbsolutePath
|
||||
#else
|
||||
import Foundation
|
||||
import LanguageServerProtocol
|
||||
import LanguageServerProtocolExtensions
|
||||
import SKLogging
|
||||
|
||||
import struct TSCBasic.AbsolutePath
|
||||
#endif
|
||||
|
||||
/// Options that can be used to modify SourceKit-LSP's behavior.
|
||||
///
|
||||
|
||||
@@ -10,11 +10,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if compiler(>=6)
|
||||
package import XCTest
|
||||
#else
|
||||
import XCTest
|
||||
#endif
|
||||
|
||||
/// Same as `XCTAssertNoThrow` but executes the trailing closure.
|
||||
package func assertNoThrow<T>(
|
||||
|
||||
@@ -10,11 +10,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if compiler(>=6)
|
||||
package import LanguageServerProtocol
|
||||
#else
|
||||
import LanguageServerProtocol
|
||||
#endif
|
||||
|
||||
extension Array<CompletionItem> {
|
||||
/// Remove `sortText` and `data` from all completion items as these are not stable across runs. Instead, sort items
|
||||
|
||||
@@ -10,26 +10,18 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
package import BuildServerProtocol
|
||||
import BuildSystemIntegration
|
||||
package import Foundation
|
||||
package import LanguageServerProtocol
|
||||
import LanguageServerProtocolExtensions
|
||||
import SKLogging
|
||||
package import SKOptions
|
||||
import SourceKitLSP
|
||||
import SwiftExtensions
|
||||
import ToolchainRegistry
|
||||
import XCTest
|
||||
|
||||
#if compiler(>=6)
|
||||
package import BuildServerProtocol
|
||||
package import Foundation
|
||||
package import LanguageServerProtocol
|
||||
package import SKOptions
|
||||
#else
|
||||
import BuildServerProtocol
|
||||
import Foundation
|
||||
import LanguageServerProtocol
|
||||
import SKOptions
|
||||
#endif
|
||||
|
||||
// MARK: - CustomBuildServer
|
||||
|
||||
/// A build server that can be injected into `CustomBuildServerTestProject`.
|
||||
|
||||
@@ -10,11 +10,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if compiler(>=6)
|
||||
package import LanguageServerProtocol
|
||||
#else
|
||||
import LanguageServerProtocol
|
||||
#endif
|
||||
|
||||
extension DocumentDiagnosticReport {
|
||||
/// If this is a full diagnostic report, return it. Otherwise return `nil`.
|
||||
|
||||
@@ -10,15 +10,9 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if compiler(>=6)
|
||||
import BuildSystemIntegration
|
||||
import Foundation
|
||||
package import LanguageServerProtocol
|
||||
#else
|
||||
import BuildSystemIntegration
|
||||
import Foundation
|
||||
import LanguageServerProtocol
|
||||
#endif
|
||||
|
||||
package struct DummyBuildSystemManagerConnectionToClient: BuildSystemManagerConnectionToClient {
|
||||
package var clientSupportsWorkDoneProgress: Bool = false
|
||||
|
||||
@@ -11,15 +11,10 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
import Foundation
|
||||
package import SKOptions
|
||||
import SwiftExtensions
|
||||
import XCTest
|
||||
|
||||
#if compiler(>=6)
|
||||
package import SKOptions
|
||||
#else
|
||||
import SKOptions
|
||||
#endif
|
||||
|
||||
fileprivate let sdkArgs =
|
||||
if let defaultSDKPath {
|
||||
"""
|
||||
|
||||
@@ -10,11 +10,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if compiler(>=6)
|
||||
package import Foundation
|
||||
#else
|
||||
import Foundation
|
||||
#endif
|
||||
|
||||
extension FileManager {
|
||||
/// Creates files from a dictionary of path to contents.
|
||||
|
||||
@@ -10,11 +10,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if compiler(>=6)
|
||||
package import Foundation
|
||||
#else
|
||||
import Foundation
|
||||
#endif
|
||||
|
||||
extension FileManager {
|
||||
/// Returns the URLs of all files with the given file extension in the given directory (recursively).
|
||||
|
||||
@@ -10,19 +10,11 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if compiler(>=6)
|
||||
package import Foundation
|
||||
import LanguageServerProtocolExtensions
|
||||
import TSCExtensions
|
||||
|
||||
import class TSCBasic.Process
|
||||
#else
|
||||
import Foundation
|
||||
import LanguageServerProtocolExtensions
|
||||
import TSCExtensions
|
||||
|
||||
import class TSCBasic.Process
|
||||
#endif
|
||||
|
||||
#if os(Windows)
|
||||
import WinSDK
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if compiler(>=6)
|
||||
@_spi(Testing) import BuildSystemIntegration
|
||||
package import Foundation
|
||||
package import LanguageServerProtocol
|
||||
@@ -19,16 +18,6 @@ import SourceKitLSP
|
||||
import SwiftExtensions
|
||||
import TSCBasic
|
||||
import ToolchainRegistry
|
||||
#else
|
||||
@_spi(Testing) import BuildSystemIntegration
|
||||
import Foundation
|
||||
import LanguageServerProtocol
|
||||
import SKOptions
|
||||
import SourceKitLSP
|
||||
import SwiftExtensions
|
||||
import TSCBasic
|
||||
import ToolchainRegistry
|
||||
#endif
|
||||
|
||||
package struct IndexedSingleSwiftFileTestProject {
|
||||
enum Error: Swift.Error {
|
||||
|
||||
@@ -10,11 +10,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if compiler(>=6)
|
||||
package import LanguageServerProtocol
|
||||
#else
|
||||
import LanguageServerProtocol
|
||||
#endif
|
||||
|
||||
extension LocationsOrLocationLinksResponse {
|
||||
/// If this is the `locations` case, return the locations, otherwise return `nil`.
|
||||
|
||||
@@ -10,21 +10,12 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
import SwiftExtensions
|
||||
|
||||
#if compiler(>=6)
|
||||
package import Foundation
|
||||
package import LanguageServerProtocol
|
||||
package import SKOptions
|
||||
package import SourceKitLSP
|
||||
import SwiftExtensions
|
||||
package import ToolchainRegistry
|
||||
#else
|
||||
import Foundation
|
||||
import LanguageServerProtocol
|
||||
import SKOptions
|
||||
import SourceKitLSP
|
||||
import ToolchainRegistry
|
||||
#endif
|
||||
|
||||
/// The location of a test file within test workspace.
|
||||
package struct RelativeFileLocation: Hashable, ExpressibleByStringLiteral {
|
||||
|
||||
@@ -10,11 +10,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if compiler(>=6)
|
||||
public import XCTest
|
||||
#else
|
||||
import XCTest
|
||||
#endif
|
||||
|
||||
/// Base class for a performance test case in SourceKit-LSP.
|
||||
///
|
||||
|
||||
@@ -11,13 +11,8 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
import Foundation
|
||||
import ToolchainRegistry
|
||||
|
||||
#if compiler(>=6)
|
||||
package import SourceKitD
|
||||
#else
|
||||
import SourceKitD
|
||||
#endif
|
||||
import ToolchainRegistry
|
||||
|
||||
/// The path to the `SwiftSourceKitPluginTests` test bundle. This gives us a hook into the the build directory.
|
||||
private let xctestBundle: URL = {
|
||||
|
||||
@@ -10,13 +10,8 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
import SKLogging
|
||||
|
||||
#if compiler(>=6)
|
||||
package import Foundation
|
||||
#else
|
||||
import Foundation
|
||||
#endif
|
||||
import SKLogging
|
||||
|
||||
extension String {
|
||||
/// Write this string to the given URL using UTF-8 encoding.
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if compiler(>=6)
|
||||
package import Foundation
|
||||
import LanguageServerProtocolExtensions
|
||||
import SwiftExtensions
|
||||
@@ -20,17 +19,6 @@ import struct TSCBasic.AbsolutePath
|
||||
import class TSCBasic.Process
|
||||
import enum TSCBasic.ProcessEnv
|
||||
import struct TSCBasic.ProcessResult
|
||||
#else
|
||||
import Foundation
|
||||
import LanguageServerProtocolExtensions
|
||||
import SwiftExtensions
|
||||
import XCTest
|
||||
|
||||
import struct TSCBasic.AbsolutePath
|
||||
import class TSCBasic.Process
|
||||
import enum TSCBasic.ProcessEnv
|
||||
import struct TSCBasic.ProcessResult
|
||||
#endif
|
||||
|
||||
/// A SwiftPM package that gets written to disk and for which a Git repository is initialized with a commit tagged
|
||||
/// `1.0.0`. This repository can then be used as a dependency for another package, usually a `SwiftPMTestProject`.
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if compiler(>=6)
|
||||
package import Foundation
|
||||
package import LanguageServerProtocol
|
||||
package import SKOptions
|
||||
@@ -19,16 +18,6 @@ import SwiftExtensions
|
||||
import TSCBasic
|
||||
import ToolchainRegistry
|
||||
import XCTest
|
||||
#else
|
||||
import Foundation
|
||||
import LanguageServerProtocol
|
||||
import SKOptions
|
||||
import SourceKitLSP
|
||||
import SwiftExtensions
|
||||
import TSCBasic
|
||||
import ToolchainRegistry
|
||||
import XCTest
|
||||
#endif
|
||||
|
||||
package class SwiftPMTestProject: MultiFileTestProject {
|
||||
enum Error: Swift.Error {
|
||||
|
||||
@@ -10,11 +10,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if compiler(>=6)
|
||||
package import Foundation
|
||||
#else
|
||||
import Foundation
|
||||
#endif
|
||||
|
||||
/// The bundle of the currently executing test.
|
||||
package let testBundle: Bundle = {
|
||||
|
||||
@@ -10,25 +10,14 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if compiler(>=6)
|
||||
import InProcessClient
|
||||
public import LanguageServerProtocol
|
||||
package import LanguageServerProtocolJSONRPC
|
||||
package import LanguageServerProtocolExtensions
|
||||
package import LanguageServerProtocolJSONRPC
|
||||
import SwiftExtensions
|
||||
import XCTest
|
||||
|
||||
package import class Foundation.Pipe
|
||||
#else
|
||||
import InProcessClient
|
||||
import LanguageServerProtocol
|
||||
import LanguageServerProtocolJSONRPC
|
||||
import LanguageServerProtocolExtensions
|
||||
import SwiftExtensions
|
||||
import XCTest
|
||||
|
||||
import class Foundation.Pipe
|
||||
#endif
|
||||
|
||||
package final class TestJSONRPCConnection: Sendable {
|
||||
package let clientToServer: Pipe = Pipe()
|
||||
|
||||
@@ -12,25 +12,17 @@
|
||||
|
||||
import Foundation
|
||||
import InProcessClient
|
||||
package import LanguageServerProtocol
|
||||
import LanguageServerProtocolExtensions
|
||||
import LanguageServerProtocolJSONRPC
|
||||
package import SKOptions
|
||||
import SKUtilities
|
||||
import SourceKitD
|
||||
package import SourceKitLSP
|
||||
import SwiftExtensions
|
||||
import SwiftSyntax
|
||||
import XCTest
|
||||
|
||||
#if compiler(>=6)
|
||||
package import LanguageServerProtocol
|
||||
package import SKOptions
|
||||
package import SourceKitLSP
|
||||
package import ToolchainRegistry
|
||||
#else
|
||||
import LanguageServerProtocol
|
||||
import SKOptions
|
||||
import SourceKitLSP
|
||||
import ToolchainRegistry
|
||||
#endif
|
||||
import XCTest
|
||||
|
||||
extension SourceKitLSPOptions {
|
||||
package static func testDefault(
|
||||
|
||||
@@ -10,17 +10,10 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if compiler(>=6)
|
||||
package import Foundation
|
||||
package import LanguageServerProtocol
|
||||
|
||||
import struct TSCBasic.AbsolutePath
|
||||
#else
|
||||
import Foundation
|
||||
import LanguageServerProtocol
|
||||
|
||||
import struct TSCBasic.AbsolutePath
|
||||
#endif
|
||||
|
||||
package extension TextDocumentIdentifier {
|
||||
init(_ url: URL) {
|
||||
|
||||
@@ -10,11 +10,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if compiler(>=6)
|
||||
package import Foundation
|
||||
#else
|
||||
import Foundation
|
||||
#endif
|
||||
|
||||
/// The default duration how long tests should wait for responses from
|
||||
/// SourceKit-LSP / sourcekitd / clangd.
|
||||
|
||||
@@ -10,17 +10,11 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if compiler(>=6)
|
||||
package import Foundation
|
||||
package import LanguageServerProtocol
|
||||
import SwiftExtensions
|
||||
|
||||
import struct TSCBasic.AbsolutePath
|
||||
#else
|
||||
import Foundation
|
||||
import LanguageServerProtocol
|
||||
import SwiftExtensions
|
||||
import struct TSCBasic.AbsolutePath
|
||||
#endif
|
||||
|
||||
extension Language {
|
||||
var fileExtension: String {
|
||||
|
||||
@@ -10,13 +10,8 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if compiler(>=6)
|
||||
package import Dispatch
|
||||
import XCTest
|
||||
#else
|
||||
import Dispatch
|
||||
import XCTest
|
||||
#endif
|
||||
|
||||
/// Wrapper around `DispatchSemaphore` so that Swift Concurrency doesn't complain about the usage of semaphores in the
|
||||
/// tests.
|
||||
|
||||
@@ -10,19 +10,11 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if compiler(>=6)
|
||||
package import Foundation
|
||||
@preconcurrency package import IndexStoreDB
|
||||
package import LanguageServerProtocol
|
||||
import SKLogging
|
||||
import SwiftExtensions
|
||||
#else
|
||||
import Foundation
|
||||
@preconcurrency import IndexStoreDB
|
||||
import LanguageServerProtocol
|
||||
import SKLogging
|
||||
import SwiftExtensions
|
||||
#endif
|
||||
|
||||
/// Essentially a `DocumentManager` from the `SourceKitLSP` module.
|
||||
///
|
||||
|
||||
@@ -10,13 +10,8 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if compiler(>=6)
|
||||
package import IndexStoreDB
|
||||
package import Foundation
|
||||
#else
|
||||
import IndexStoreDB
|
||||
import Foundation
|
||||
#endif
|
||||
package import IndexStoreDB
|
||||
|
||||
/// When running SourceKit-LSP in-process, allows the creator of `SourceKitLSPServer` to provide the `IndexStoreDB`
|
||||
/// instead of SourceKit-LSP creating the instance when needed.
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if compiler(>=6)
|
||||
package import BuildServerProtocol
|
||||
import BuildSystemIntegration
|
||||
import Foundation
|
||||
@@ -21,18 +20,6 @@ import SwiftExtensions
|
||||
|
||||
import struct TSCBasic.AbsolutePath
|
||||
import class TSCBasic.Process
|
||||
#else
|
||||
import BuildServerProtocol
|
||||
import BuildSystemIntegration
|
||||
import Foundation
|
||||
import LanguageServerProtocol
|
||||
import LanguageServerProtocolExtensions
|
||||
import SKLogging
|
||||
import SwiftExtensions
|
||||
|
||||
import struct TSCBasic.AbsolutePath
|
||||
import class TSCBasic.Process
|
||||
#endif
|
||||
|
||||
private let preparationIDForLogging = AtomicUInt32(initialValue: 1)
|
||||
|
||||
|
||||
@@ -10,23 +10,13 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
import LanguageServerProtocolExtensions
|
||||
|
||||
#if compiler(>=6)
|
||||
package import BuildServerProtocol
|
||||
package import BuildSystemIntegration
|
||||
import Foundation
|
||||
package import LanguageServerProtocol
|
||||
import LanguageServerProtocolExtensions
|
||||
import SKLogging
|
||||
import SwiftExtensions
|
||||
#else
|
||||
import BuildServerProtocol
|
||||
import BuildSystemIntegration
|
||||
import Foundation
|
||||
import LanguageServerProtocol
|
||||
import SKLogging
|
||||
import SwiftExtensions
|
||||
#endif
|
||||
|
||||
/// The logging subsystem that should be used for all index-related logging.
|
||||
let indexLoggingSubsystem = "org.swift.sourcekit-lsp.indexing"
|
||||
|
||||
@@ -10,17 +10,10 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if compiler(>=6)
|
||||
import Foundation
|
||||
import LanguageServerProtocolExtensions
|
||||
package import SKLogging
|
||||
import SwiftExtensions
|
||||
#else
|
||||
import Foundation
|
||||
import LanguageServerProtocolExtensions
|
||||
import SKLogging
|
||||
import SwiftExtensions
|
||||
#endif
|
||||
|
||||
/// See comment on ``TaskDescriptionProtocol/dependencies(to:taskPriority:)``
|
||||
package enum TaskDependencyAction<TaskDescription: TaskDescriptionProtocol> {
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if compiler(>=6)
|
||||
package import BuildServerProtocol
|
||||
import BuildSystemIntegration
|
||||
import Foundation
|
||||
@@ -18,29 +17,13 @@ package import LanguageServerProtocol
|
||||
import LanguageServerProtocolExtensions
|
||||
import SKLogging
|
||||
import SwiftExtensions
|
||||
import ToolchainRegistry
|
||||
import TSCExtensions
|
||||
import ToolchainRegistry
|
||||
|
||||
import struct TSCBasic.AbsolutePath
|
||||
import class TSCBasic.Process
|
||||
import struct TSCBasic.ProcessResult
|
||||
import enum TSCBasic.SystemError
|
||||
#else
|
||||
import BuildServerProtocol
|
||||
import BuildSystemIntegration
|
||||
import Foundation
|
||||
import LanguageServerProtocol
|
||||
import LanguageServerProtocolExtensions
|
||||
import SKLogging
|
||||
import SwiftExtensions
|
||||
import ToolchainRegistry
|
||||
import TSCExtensions
|
||||
|
||||
import struct TSCBasic.AbsolutePath
|
||||
import class TSCBasic.Process
|
||||
import struct TSCBasic.ProcessResult
|
||||
import enum TSCBasic.SystemError
|
||||
#endif
|
||||
|
||||
#if os(Windows)
|
||||
import WinSDK
|
||||
|
||||
@@ -10,17 +10,10 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if compiler(>=6)
|
||||
package import Csourcekitd
|
||||
package import Foundation
|
||||
import SKLogging
|
||||
import SwiftExtensions
|
||||
#else
|
||||
import Csourcekitd
|
||||
import Foundation
|
||||
import SKLogging
|
||||
import SwiftExtensions
|
||||
#endif
|
||||
|
||||
extension sourcekitd_api_keys: @unchecked Sendable {}
|
||||
extension sourcekitd_api_requests: @unchecked Sendable {}
|
||||
|
||||
@@ -10,11 +10,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if compiler(>=6)
|
||||
package import Csourcekitd
|
||||
#else
|
||||
import Csourcekitd
|
||||
#endif
|
||||
|
||||
#if canImport(Darwin)
|
||||
import Darwin
|
||||
|
||||
@@ -10,13 +10,8 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if compiler(>=6)
|
||||
package import Csourcekitd
|
||||
import SKLogging
|
||||
#else
|
||||
import Csourcekitd
|
||||
import SKLogging
|
||||
#endif
|
||||
|
||||
#if canImport(Darwin)
|
||||
import Darwin
|
||||
|
||||
@@ -10,13 +10,8 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#if compiler(>=6)
|
||||
package import Csourcekitd
|
||||
import SKLogging
|
||||
#else
|
||||
import Csourcekitd
|
||||
import SKLogging
|
||||
#endif
|
||||
|
||||
#if canImport(Darwin)
|
||||
import Darwin
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user