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 {
68
68
)
69
69
var toolchainOverride : String ?
70
70
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
+
71
80
@Option ( help: " The path to the project that should be indexed " )
72
81
var project : String
73
82
74
83
public init ( ) { }
75
84
76
85
public func run( ) async throws {
77
86
var serverOptions = SourceKitLSPServer . Options ( )
87
+ serverOptions. experimentalFeatures = Set ( experimentalFeatures)
78
88
serverOptions. experimentalFeatures. insert ( . backgroundIndexing)
79
89
80
90
let installPath =
@@ -109,3 +119,9 @@ fileprivate extension SourceKitLSPServer {
109
119
}
110
120
}
111
121
}
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 {
289
289
}
290
290
}
291
291
}
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