Skip to content

Interactive Window creation and restore #10808

Closed
@rebornix

Description

@rebornix

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 with owner and mode, push it to _windows in both cases (create or restore)
  • Have one explicit start method to get the InteractiveWindow 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
    • 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

Metadata

Metadata

Assignees

Labels

debtCode quality issuesinteractive-windowImpacts interactive window

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions