(increment?: boolean)
| 23 | let numCompleted = 0; |
| 24 | |
| 25 | function updateProgress(increment?: boolean) { |
| 26 | const activePackageNames = [...activePackages.values()]; |
| 27 | const firstPackageName = activePackageNames[0]; |
| 28 | const numTotal = uris.length; |
| 29 | const numRemaining = numTotal - numCompleted; |
| 30 | |
| 31 | // Instead of using the actual count here (activePackageNames.length - 1), which causes |
| 32 | // flickering as one completes and reduces the count before the next starts, just give |
| 33 | // an approximate value of the cap of Min(maxConcurrent, remaining) - 1 instead. |
| 34 | const otherActiveCount = Math.min(maxConcurrent, numRemaining) - 1; |
| 35 | if (firstPackageName) { |
| 36 | const statusMessage = otherActiveCount > 0 |
| 37 | ? `${firstPackageName} (+ ${otherActiveCount} others)...` |
| 38 | : firstPackageName; |
| 39 | operationProgress.progressReporter.report({ |
| 40 | message: `${statusMessage} (${numCompleted}/${numTotal} total)`, |
| 41 | increment: increment ? 100 / numTotal : undefined, |
| 42 | }); |
| 43 | } |
| 44 | } |
| 45 | |
| 46 | updateProgress(); |
| 47 | await runWithConcurrencyLimit( |
no test coverage detected