repl: Refactor outputs for externalization (#16971)

Working on addressing large outputs, refactored as part of it.



https://github.com/user-attachments/assets/48ea576c-e13a-4d09-b45a-4baa41bf6f72



Release Notes:

- N/A
This commit is contained in:
Kyle Kelley 2024-08-29 12:41:03 -07:00 committed by GitHub
parent 89487772b0
commit 82ceb4c091
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 359 additions and 202 deletions

View file

@ -60,7 +60,16 @@ impl EditorBlock {
on_close: CloseBlockFn,
cx: &mut ViewContext<Session>,
) -> anyhow::Result<Self> {
let execution_view = cx.new_view(|cx| ExecutionView::new(status, cx));
let editor = editor
.upgrade()
.ok_or_else(|| anyhow::anyhow!("editor is not open"))?;
let workspace = editor
.read(cx)
.workspace()
.ok_or_else(|| anyhow::anyhow!("workspace dropped"))?;
let execution_view =
cx.new_view(|cx| ExecutionView::new(status, workspace.downgrade(), cx));
let (block_id, invalidation_anchor) = editor.update(cx, |editor, cx| {
let buffer = editor.buffer().clone();
@ -93,7 +102,7 @@ impl EditorBlock {
let block_id = editor.insert_blocks([block], None, cx)[0];
(block_id, invalidation_anchor)
})?;
});
anyhow::Ok(Self {
code_range,