mirror of
https://github.com/leporello-js/leporello-js
synced 2026-01-13 13:04:30 -08:00
show value explorer on edit async code
This commit is contained in:
13
src/cmd.js
13
src/cmd.js
@@ -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, eval_modules_state: null}
|
||||
|
||||
return do_move_cursor(
|
||||
eval_state_clear,
|
||||
current_cursor_position(eval_state_clear)
|
||||
)
|
||||
}
|
||||
|
||||
const input = (state, code, index) => {
|
||||
@@ -282,13 +287,7 @@ const input = (state, code, index) => {
|
||||
next.current_module,
|
||||
next.files[next.current_module],
|
||||
]}
|
||||
if(next.loading_external_imports_state != null) {
|
||||
return {state: next, effects: [effect_save]}
|
||||
}
|
||||
return {
|
||||
state: do_move_cursor(next, index),
|
||||
effects: [effect_save],
|
||||
}
|
||||
}
|
||||
|
||||
const can_evaluate_node = (parent, node) => {
|
||||
|
||||
@@ -2885,6 +2885,7 @@ const y = x()`
|
||||
after_edit.eval_modules_state.toplevel
|
||||
)
|
||||
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 () => {
|
||||
|
||||
Reference in New Issue
Block a user