show value explorer when focus calltree view

This commit is contained in:
Dmitry Vasilev
2024-02-02 01:57:48 +08:00
parent f4e531d24c
commit 5a5eedb89a
3 changed files with 19 additions and 6 deletions

View File

@@ -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,11 +295,13 @@ const jump_calltree_node = (_state, _current_calltree_node) => {
}
}
const with_location = next.current_calltree_node.toplevel
? {...next, current_module: loc.module}
// TODO: better jump not start of function (arguments), but start
// of body?
: set_location(next, loc)
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?
: set_location(next, loc)
const with_selected_calltree_node = set_selected_calltree_node_by_loc(
with_location,
@@ -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,
}

View File

@@ -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

View File

@@ -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() {