Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notebook: Find across cells (content based) #91327

Closed
8 tasks done
rebornix opened this issue Feb 25, 2020 · 0 comments
Closed
8 tasks done

Notebook: Find across cells (content based) #91327

rebornix opened this issue Feb 25, 2020 · 0 comments
Assignees
Labels
feature-request Request for new features or functionality notebook on-testplan
Milestone

Comments

@rebornix
Copy link
Member

rebornix commented Feb 25, 2020

The notebook rendering is virtualized, thus when we do search and replace in a notebook, we need to operate on the the underlining text model. The text model behind a notebook document is an array of text or ITextModel:

- text
- text
- `ITextModel`, resolved from text when the cell is rendered in the view 
- text

When Find/Replace starts, we will run search on every cell. To leverage the existing search functionality in Monaco Editor, the whole process will fall into following steps:

  • ICell converts text sources to PieceTreeTextBufferFactory
    • If a cell is not visible, we will create a PieceTreeTextBuffer from the buffer factory, run query on the buffer
    • If a cell is visible and there is already a text model created for it (which is created from the same buffer factory, thus they share the same immutable data structure for content, memory saved 📝 ). We run query directly on text model.
  • There will be a managed find controller for each notebook editor, which will
    • manage the states of find matches, active match, etc
    • push decorations to monaco editors
  • Notebook Editor will be responsible to reveal the cell which has the active match into view
    • If there is folding/virtualization in Monaco Editor, it needs to reveal both the cell and the line in the nested editor
@rebornix rebornix added feature-request Request for new features or functionality notebook labels Feb 25, 2020
@rebornix rebornix added this to the March 2020 milestone Feb 25, 2020
@rebornix rebornix self-assigned this Feb 25, 2020
@github-actions github-actions bot locked and limited conversation to collaborators May 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality notebook on-testplan
Projects
None yet
Development

No branches or pull requests

1 participant