Ah, I found the code for it. I think it may be that I was using the passed in scope in the com.intellij.openapi.wm.StatusBarWidgetFactory#createWidget(com.intellij.openapi.project.Project, kotlinx.coroutines.CoroutineScope) which is CoroutineName(com.intellij.openapi.wm.impl.status.widget.StatusBarWidgetsManager)
and not the plugin coroutine scope like I was expecting so some of the flows seem to be staying alive
Widget creation:
My code path hits line 253, and so it doesn’t create a child scope like WidgetPresentationWrapper does (which does cancel the ${factory.id}-widget scope on disposable of the wrapper)
so it looks like a StatusBarWidgetFactory that is not also a WidgetPresentationFactory can leak coroutine scopes on plugin unload
Though that still will leak on manual removal of a widget for the stable status bar API types, same as the status quo today, since removal of a widget doesn’t have access to the coroutine scope and the default behavior does not cancel the scope on dispose, which the WidgetPresentationWrapper does handle for the widget factory