louiscad
01/22/2025, 12:10 PMwhatever.
or a trailing lambda argument (coroutineScope
and collect
on this example)
The suspend call gutter icon in IntelliJ IDEA and Android Studio is a lot easier to read, thanks to vertical alignment, and far more reliable.
Please, just stick to that.
Here's a related issue I submitted 10 months ago, but only pushbacks and no progress since then kodee grumpyDmitry Khalanskiy [JB]
01/22/2025, 12:20 PMkotlinx.coroutines
user: I have no idea what those icons (whether gutter or inline) are even for, I'm never looking at them. I can imagine the use case of searching for function calls that look like they could be blocking but aren't suspend
, but in that case, inline icons are better than gutter icons: if there is a blocking call on the same line as a suspend
call, I won't accidentally skip looking at it. Could you share some advice on how to get something useful out of these icons?louiscad
01/22/2025, 12:30 PMawait
prefix keywords (BTW, they're mandatory, unless you use let async
, asynchronous tasks can't be started by mistake, the code won't compile unless you explictly choose between sequential or async).Dmitry Khalanskiy [JB]
01/22/2025, 12:33 PMlouiscad
01/22/2025, 12:34 PMDmitry Khalanskiy [JB]
01/22/2025, 12:36 PMDispatchers.Main
users), so gutter icons should help with tracking state that only the main thread has access to.louiscad
01/22/2025, 12:36 PM@Composable
functions that are in bright-ish green (for light color scheme), those would also be fairly easy to spot without focusing on every part of every single line one wants to scan.louiscad
01/22/2025, 12:38 PMDmitry Khalanskiy [JB]
01/22/2025, 12:39 PMDepending on the code, it helps to know if I can assume a property stayed unchanged, or might have been touched by something.But you can rely on gutter icons to tell you that only if the coroutines that have access to that property can't execute in parallel, right? Once more than one thread can touch the property, how can gutter icons still be helpful?
louiscad
01/22/2025, 1:20 PMross_a
01/22/2025, 7:21 PMlouiscad
01/23/2025, 7:23 AMlouiscad
01/23/2025, 7:25 AMross_a
01/23/2025, 8:44 AMross_a
01/23/2025, 8:45 AMlouiscad
01/23/2025, 9:23 AMross_a
01/23/2025, 9:26 AMturansky
02/13/2025, 9:43 PMWho makes single-thread Kotlin apps, apart from Kotlin/JS developers?Web Workers works fine ๐ Especially with worker factories