(file: vs.Uri)
| 1186 | } |
| 1187 | |
| 1188 | export async function writeBrokenDartCodeIntoFileForTest(file: vs.Uri): Promise<void> { |
| 1189 | const nextAnalysis = privateApi.nextAnalysis(); |
| 1190 | fs.writeFileSync(fsPath(file), "this is broken dart code"); |
| 1191 | await nextAnalysis; |
| 1192 | // HACK: Sometimes we see analysis the analysis flag toggle quickly and we get an empty error list |
| 1193 | // so we need to add a small delay here and then wait for any in progress analysis. |
| 1194 | await delay(50); |
| 1195 | await privateApi.currentAnalysis(); |
| 1196 | defer("Remove broken Dart file", () => tryDelete(file)); |
| 1197 | } |
| 1198 | |
| 1199 | export function deleteFileIfExists(filePath: string) { |
| 1200 | if (fs.existsSync(filePath)) { |
no test coverage detected