In Kotlin Coroutine Confidence <@U030S9809PH> off ...
# coroutines
d
In Kotlin Coroutine Confidence @Sam off the cuff says that IntelliJ shows potentially blocking coroutine calls. I don't see that nor how to enable it. Is it only in AndroidStudio or am I missing it? I even put
Thread.sleep(999)
in a
suspend
method and intelliJ didn't slap my hand.
k
I think mostly this is detected when a function throws Java's IOException iirc
thank you color 1
sad panda 1
It's not perfect.
s
Here's what I get in IDEA 2024.3.5 (CE). The yellow highlight is always there; the tooltip with the warning shows up on mouseover. Very interested to hear if you get a different result!
I agree with Kevin though, the IDE warnings can be inconsistent, they're definitely not perfect
d
hmm, IntelliJ IDEA 2024.3.5 (Ultimate Edition), Kotlin plugin: K2 mode
found the setting but it's enabled
s
🤦 sounds like K2 mode is what makes the difference. I've been avoiding it, because it's missing features I need, and indeed when I turn it on that warning goes away
lol 1
Thanks for spotting the discrepancy! Guess I'll need to add another caveat to the book 😞
d
hopefully it will be fixed before the book goes GA
s
We can hope 😄🤞 I have a feeling the list of missing IDE inspections/warnings/refactorings in K2 mode is getting quite long at this point
1
You'd think they would have fixed it before K2 went GA, but there you go…
d
Yeah, I dont rmember why i turned it on but something wasn't working and some intellij page said k2 would fix it iirc
👍 1
e
the heuristic behind that inspection is pretty incomplete anyhow
👍 1