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(
|
const {state, node: current_calltree_node} = expand_calltree_node(
|
||||||
_state, _current_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
|
const with_location = do_not_set_location
|
||||||
? {...next, current_module: loc.module}
|
? next
|
||||||
// TODO: better jump not start of function (arguments), but start
|
: next.current_calltree_node.toplevel
|
||||||
// of body?
|
? {...next, current_module: loc.module}
|
||||||
: set_location(next, loc)
|
// 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(
|
const with_selected_calltree_node = set_selected_calltree_node_by_loc(
|
||||||
with_location,
|
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) => {
|
export const path_to_root = (root, child) => {
|
||||||
const do_path = (root) => {
|
const do_path = (root) => {
|
||||||
if(root.id == child.id) {
|
if(root.id == child.id) {
|
||||||
@@ -950,4 +956,5 @@ export const calltree_commands = {
|
|||||||
select_error,
|
select_error,
|
||||||
navigate_logs_position,
|
navigate_logs_position,
|
||||||
navigate_logs_increment,
|
navigate_logs_increment,
|
||||||
|
show_value_explorer,
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -791,6 +791,8 @@ const get_value_explorer = (state, index) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const do_move_cursor = (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)
|
const value_explorer = get_value_explorer(state, index)
|
||||||
if(
|
if(
|
||||||
value_explorer != null
|
value_explorer != null
|
||||||
|
|||||||
@@ -205,6 +205,10 @@ export class UI {
|
|||||||
if(!skip_focus) {
|
if(!skip_focus) {
|
||||||
this.debugger[tab_id].focus()
|
this.debugger[tab_id].focus()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(tab_id == 'calltree' && !skip_focus) {
|
||||||
|
exec('calltree.show_value_explorer')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
open_app_window() {
|
open_app_window() {
|
||||||
|
|||||||
Reference in New Issue
Block a user