Closed
Description
Follow up item of #10785 (comment)
Currently the interactive window is created in an asynchronous fashion (due to the async kernel detection), there is a chance of race condition (InteractiveWindowProvider._windows
still empty when multiple clicks happen on Run Cell code lens). Supporting hot exit for Interactive Window also makes the workflow more complex as the hot exit / window restore happens synchronous at extension activation, before we have all notebook controllers ready.
A proposal coming from discussions in #10785 (comment) is
- Create
InteractiveWindow
immediately withowner
andmode
, push it to_windows
in both cases (create or restore) - Have one explicit
start
method to get theInteractiveWindow
prepared for cell execution, which includes- If it's new IW
- Get
preferredController
- Call
interactive.open
to create the IW editor in VS Code - Start kernel
- Get
- If it's a restored IW, we then have the
InteractiveTab
- Reveal the tab into view (currently we use
openNotebookDocument
API, in the future we would have Tab API to archive this) - Get
preferredController
and set it as the active controller (maybe we don't need this as the notebook controller provider already tells VS Code which controller to use) - Start kernel
- Reveal the tab into view (currently we use
- If it's new IW