File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -120,7 +120,9 @@ final class BuildSystemTests: XCTestCase {
120
120
await buildSystem. setBuildSettings ( for: doc, to: newSettings)
121
121
122
122
try await repeatUntilExpectedResult {
123
- let refreshedDiags = try await testClient. nextDiagnosticsNotification ( timeout: . seconds( 1 ) )
123
+ guard let refreshedDiags = try ? await testClient. nextDiagnosticsNotification ( timeout: . seconds( 1 ) ) else {
124
+ return false
125
+ }
124
126
return try text == documentManager. latestSnapshot ( doc) . text && refreshedDiags. diagnostics. count == 0
125
127
}
126
128
}
Original file line number Diff line number Diff line change @@ -195,14 +195,14 @@ final class MainFilesProviderTests: XCTestCase {
195
195
DidChangeWatchedFilesNotification ( changes: [ FileEvent ( uri: fancyLibraryUri, type: . changed) ] )
196
196
)
197
197
198
- // 'MyFancyLibrary.c' now also includes 'shared.h'. Since it lexicographically preceeds MyLibrary, we should use its
198
+ // 'MyFancyLibrary.c' now also includes 'shared.h'. Since it lexicographically precedes MyLibrary, we should use its
199
199
// build settings.
200
200
// `clangd` may return diagnostics from the old build settings sometimes (I believe when it's still building the
201
201
// preamble for shared.h when the new build settings come in). Check that it eventually returns the correct
202
202
// diagnostics.
203
203
try await repeatUntilExpectedResult {
204
- let refreshedDiags = try await project. testClient. nextDiagnosticsNotification ( timeout: . seconds( 1 ) )
205
- guard let diagnostic = refreshedDiags. diagnostics. only else {
204
+ let refreshedDiags = try ? await project. testClient. nextDiagnosticsNotification ( timeout: . seconds( 1 ) )
205
+ guard let diagnostic = refreshedDiags? . diagnostics. only else {
206
206
return false
207
207
}
208
208
return diagnostic. message == " Unused variable 'fromMyFancyLibrary' "
You can’t perform that action at this time.
0 commit comments