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:
parent
89487772b0
commit
82ceb4c091
7 changed files with 359 additions and 202 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue