Is it possible to run "inspect" and "codegen" modes at the same time?

My plugin supports both inspect and codegen modes.

When Dev Mode is enabled and the inspect mode is active, my plugin is properly loaded in the Plugins panel.

However, If I go back to the inspect panel and try to check the generated code, the UI says

PluginName is running in the background

And offers the option to close the plugin and generate the code.

Is it possible to make these 2 modes coexist?

I foresee my inspect mode executing some tasks that could take a while, so letting the user close the plugin would interrupt that process in the middle.

If both modes can’t coexist, what is the recommended way to go for this use case?