show value explorer on edit async code

This commit is contained in:
Dmitry Vasilev
2023-01-15 20:56:54 +08:00
parent 659f5c11cd
commit 723296a46c
2 changed files with 8 additions and 8 deletions

View File

@@ -265,9 +265,14 @@ const eval_modules_finished = (state, prev_state, result, node, toplevel) => {
) )
} }
return result_state.eval_modules_state == null const eval_state_clear = result_state.eval_modules_state == null
? result_state ? result_state
: {...result_state, eval_modules_state: null} : {...result_state, eval_modules_state: null}
return do_move_cursor(
eval_state_clear,
current_cursor_position(eval_state_clear)
)
} }
const input = (state, code, index) => { const input = (state, code, index) => {
@@ -282,13 +287,7 @@ const input = (state, code, index) => {
next.current_module, next.current_module,
next.files[next.current_module], next.files[next.current_module],
]} ]}
if(next.loading_external_imports_state != null) { return {state: next, effects: [effect_save]}
return {state: next, effects: [effect_save]}
}
return {
state: do_move_cursor(next, index),
effects: [effect_save],
}
} }
const can_evaluate_node = (parent, node) => { const can_evaluate_node = (parent, node) => {

View File

@@ -2885,6 +2885,7 @@ const y = x()`
after_edit.eval_modules_state.toplevel after_edit.eval_modules_state.toplevel
) )
assert_equal(after_edit_finished.active_calltree_node.fn.name, 'f') assert_equal(after_edit_finished.active_calltree_node.fn.name, 'f')
assert_equal(after_edit_finished.value_explorer.result.value, 1)
}), }),
test('async/await move_cursor', async () => { test('async/await move_cursor', async () => {