@@ -176,18 +176,18 @@ public struct UpdateIndexStoreTaskDescription: TaskDescriptionProtocol {
176
176
buildSettings: FileBuildSettings ,
177
177
toolchain: Toolchain
178
178
) async throws {
179
- let indexingArguments = adjustSwiftCompilerArgumentsForIndexStoreUpdate (
180
- buildSettings. compilerArguments,
181
- fileToIndex: uri
182
- )
183
-
184
179
guard let swiftc = toolchain. swiftc else {
185
180
logger. error (
186
181
" Not updating index store for \( uri. forLogging) because toolchain \( toolchain. identifier) does not contain a Swift compiler "
187
182
)
188
183
return
189
184
}
190
185
186
+ let indexingArguments = adjustSwiftCompilerArgumentsForIndexStoreUpdate (
187
+ buildSettings. compilerArguments,
188
+ fileToIndex: uri
189
+ )
190
+
191
191
let process = try Process . launch (
192
192
arguments: [ swiftc. pathString] + indexingArguments,
193
193
workingDirectory: buildSettings. workingDirectory. map ( AbsolutePath . init ( validating: ) )
@@ -289,7 +289,6 @@ private func adjustSwiftCompilerArgumentsForIndexStoreUpdate(
289
289
result += [ argument, nextArgument]
290
290
continue
291
291
}
292
- result. append ( argument)
293
292
}
294
293
result. append ( argument)
295
294
}
@@ -299,7 +298,7 @@ private func adjustSwiftCompilerArgumentsForIndexStoreUpdate(
299
298
// batch mode is not compatible with -index-file
300
299
" -disable-batch-mode " ,
301
300
// Fake an output path so that we get a different unit file for every Swift file we background index
302
- " -o " , fileToIndex. pseudoPath + " .o " ,
301
+ " -index-unit-output-path " , fileToIndex. pseudoPath + " .o " ,
303
302
]
304
303
return result
305
304
}
0 commit comments