IntelliJ IDEA's New Kotlin Coroutine Inspections, Explained | The IntelliJ IDEA Blog
Blog post from JetBrains
IntelliJ IDEA has introduced new Kotlin coroutine inspections to help developers write cleaner and more efficient code, addressing common issues in codebases that Marcin MoskaĆa, a Kotlin expert, has often encountered. These inspections, available in IntelliJ IDEA 2025.2 and later, aim to guide developers in adopting best practices, such as using `awaitAll()` and `joinAll()` for cleaner and more efficient task handling, employing `currentCoroutineContext()` instead of `coroutineContext` to avoid context mismanagement, and avoiding `runBlocking` inside suspending functions to prevent thread blocking. The inspections also discourage using `Job` as an argument in coroutine starters due to its potential to disrupt structured concurrency, advise using `suspendCancellableCoroutine` over `suspendCoroutine` for better cancellation support, and highlight the importance of scope management to prevent memory leaks. Additionally, the IDE suggests simpler operations for flow processing, like `mapNotNull`, enhancing the core development experience by making correct usage more intuitive while mitigating common pitfalls.