Skip to content

NotebookTextModel debt #105735

@jrieken

Description

@jrieken

The NotebookTextModel is an important backbone of the notebooks model and therefore we should cleanup some debt that has accumulated:

  • NotebookTextModel#selections is a view/editor property and not a model property
  • the this._onDidModelChangeProxy-event in combination with emitToExtHost. There should be no difference is model changes that go to the extension host and other subscribers/consumers. All events should be equal and mainThreadNotebook is just one of many consumers which special role is to manage a "copy" in the extension host
  • some duplication in how cells are inserted, removed, and edited. We should make applyEdit the one-stop-shop.
  • a notebook text model knows if its dirty and emit corresponding events. One could argue that dirty-state manage is the business of NotebookEditorModel which is already doing saving etc.
  • every change of the version id must be forwarded to the extension host (see Using applyEdit with replaceCellMetadata or replaceCellOutput fails with no output #105624 (comment))

Metadata

Metadata

Labels

debtCode quality issuesinsiders-releasedPatch has been released in VS Code Insidersnotebook

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions