Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions Sources/Diagnose/IndexCommand.swift
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,23 @@ public struct IndexCommand: AsyncParsableCommand {
)
var toolchainOverride: String?

@Option(
name: .customLong("experimental-index-feature"),
help: """
Enable an experimental sourcekit-lsp feature.
Available features are: \(ExperimentalFeature.allCases.map(\.rawValue).joined(separator: ", "))
"""
)
var experimentalFeatures: [ExperimentalFeature] = []

@Option(help: "The path to the project that should be indexed")
var project: String

public init() {}

public func run() async throws {
var serverOptions = SourceKitLSPServer.Options()
serverOptions.experimentalFeatures = Set(experimentalFeatures)
serverOptions.experimentalFeatures.insert(.backgroundIndexing)

let installPath =
Expand Down Expand Up @@ -109,3 +119,9 @@ fileprivate extension SourceKitLSPServer {
}
}
}

#if compiler(>=6)
extension ExperimentalFeature: @retroactive ExpressibleByArgument {}
#else
extension ExperimentalFeature: ExpressibleByArgument {}
#endif
6 changes: 0 additions & 6 deletions Sources/sourcekit-lsp/SourceKitLSP.swift
Original file line number Diff line number Diff line change
Expand Up @@ -289,9 +289,3 @@ struct SourceKitLSP: AsyncParsableCommand {
}
}
}

#if compiler(>=6)
extension ExperimentalFeature: @retroactive ExpressibleByArgument {}
#else
extension ExperimentalFeature: ExpressibleByArgument {}
#endif