mirror of
https://github.com/apple/sourcekit-lsp.git
synced 2026-03-02 18:23:24 +01:00
If a build server doesn’t specify -index-store-path in the SourceKit options, add it during background indexing
This commit is contained in:
@@ -24,10 +24,10 @@ import LanguageServerProtocol
|
||||
#endif
|
||||
|
||||
func lastIndexStorePathArgument(in compilerArgs: [String]) -> String? {
|
||||
for i in compilerArgs.indices.reversed() {
|
||||
if compilerArgs[i] == "-index-store-path" && i + 1 < compilerArgs.count {
|
||||
return compilerArgs[i + 1]
|
||||
}
|
||||
if let indexStorePathIndex = compilerArgs.lastIndex(of: "-index-store-path"),
|
||||
indexStorePathIndex + 1 < compilerArgs.count
|
||||
{
|
||||
return compilerArgs[indexStorePathIndex + 1]
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user