mirror of
https://github.com/leporello-js/leporello-js
synced 2026-01-13 13:04:30 -08:00
show value explorer when focus calltree view
This commit is contained in:
@@ -236,7 +236,7 @@ const expand_calltree_node = (state, node) => {
|
||||
}
|
||||
}
|
||||
|
||||
const jump_calltree_node = (_state, _current_calltree_node) => {
|
||||
const jump_calltree_node = (_state, _current_calltree_node, do_not_set_location = false) => {
|
||||
const {state, node: current_calltree_node} = expand_calltree_node(
|
||||
_state, _current_calltree_node
|
||||
)
|
||||
@@ -295,7 +295,9 @@ const jump_calltree_node = (_state, _current_calltree_node) => {
|
||||
}
|
||||
}
|
||||
|
||||
const with_location = next.current_calltree_node.toplevel
|
||||
const with_location = do_not_set_location
|
||||
? next
|
||||
: next.current_calltree_node.toplevel
|
||||
? {...next, current_module: loc.module}
|
||||
// TODO: better jump not start of function (arguments), but start
|
||||
// of body?
|
||||
@@ -354,6 +356,10 @@ const jump_calltree_node = (_state, _current_calltree_node) => {
|
||||
}
|
||||
}
|
||||
|
||||
const show_value_explorer = state => {
|
||||
return jump_calltree_node(state, state.current_calltree_node, true)
|
||||
}
|
||||
|
||||
export const path_to_root = (root, child) => {
|
||||
const do_path = (root) => {
|
||||
if(root.id == child.id) {
|
||||
@@ -950,4 +956,5 @@ export const calltree_commands = {
|
||||
select_error,
|
||||
navigate_logs_position,
|
||||
navigate_logs_increment,
|
||||
show_value_explorer,
|
||||
}
|
||||
|
||||
@@ -791,6 +791,8 @@ const get_value_explorer = (state, index) => {
|
||||
}
|
||||
|
||||
const do_move_cursor = (state, index) => {
|
||||
// TODO: if value explorer is null, show current fn return value and args?
|
||||
|
||||
const value_explorer = get_value_explorer(state, index)
|
||||
if(
|
||||
value_explorer != null
|
||||
|
||||
@@ -205,6 +205,10 @@ export class UI {
|
||||
if(!skip_focus) {
|
||||
this.debugger[tab_id].focus()
|
||||
}
|
||||
|
||||
if(tab_id == 'calltree' && !skip_focus) {
|
||||
exec('calltree.show_value_explorer')
|
||||
}
|
||||
}
|
||||
|
||||
open_app_window() {
|
||||
|
||||
Reference in New Issue
Block a user