File tree Expand file tree Collapse file tree 2 files changed +16
-6
lines changed Expand file tree Collapse file tree 2 files changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -68,13 +68,23 @@ public struct IndexCommand: AsyncParsableCommand {
6868 )
6969 var toolchainOverride : String ?
7070
71+ @Option (
72+ name: . customLong( " experimental-index-feature " ) ,
73+ help: """
74+ Enable an experimental sourcekit-lsp feature.
75+ Available features are: \( ExperimentalFeature . allCases. map ( \. rawValue) . joined ( separator: " , " ) )
76+ """
77+ )
78+ var experimentalFeatures : [ ExperimentalFeature ] = [ ]
79+
7180 @Option ( help: " The path to the project that should be indexed " )
7281 var project : String
7382
7483 public init ( ) { }
7584
7685 public func run( ) async throws {
7786 var serverOptions = SourceKitLSPServer . Options ( )
87+ serverOptions. experimentalFeatures = Set ( experimentalFeatures)
7888 serverOptions. experimentalFeatures. insert ( . backgroundIndexing)
7989
8090 let installPath =
@@ -109,3 +119,9 @@ fileprivate extension SourceKitLSPServer {
109119 }
110120 }
111121}
122+
123+ #if compiler(>=6)
124+ extension ExperimentalFeature : @retroactive ExpressibleByArgument { }
125+ #else
126+ extension ExperimentalFeature : ExpressibleByArgument { }
127+ #endif
Original file line number Diff line number Diff line change @@ -289,9 +289,3 @@ struct SourceKitLSP: AsyncParsableCommand {
289289 }
290290 }
291291}
292-
293- #if compiler(>=6)
294- extension ExperimentalFeature : @retroactive ExpressibleByArgument { }
295- #else
296- extension ExperimentalFeature : ExpressibleByArgument { }
297- #endif
You can’t perform that action at this time.
0 commit comments