plug in fancy member names to watch views

This commit is contained in:
Ryan Fleury
2025-02-11 14:03:28 -08:00
parent ee984877b0
commit 82803e710e
5 changed files with 28 additions and 4 deletions
+5 -1
View File
@@ -28,7 +28,7 @@ RD_CmdKind_Null,
RD_CmdKind_Null,
};
RD_VocabularyInfo rd_vocabulary_info_table[60] =
RD_VocabularyInfo rd_vocabulary_info_table[64] =
{
{str8_lit_comp("auto_view_rule"), str8_lit_comp("auto_view_rules"), str8_lit_comp("Auto View Rule"), str8_lit_comp("Auto View Rules"), RD_IconKind_Binoculars},
{str8_lit_comp("file_path_map"), str8_lit_comp("file_path_maps"), str8_lit_comp("File Path Map"), str8_lit_comp("File Path Maps"), RD_IconKind_FileOutline},
@@ -90,6 +90,10 @@ RD_VocabularyInfo rd_vocabulary_info_table[60] =
{str8_lit_comp("register"), str8_lit_comp("registers"), str8_lit_comp("Register"), str8_lit_comp("Registers"), RD_IconKind_Null},
{str8_lit_comp("local"), str8_lit_comp("locals"), str8_lit_comp("Local"), str8_lit_comp("Locals"), RD_IconKind_Null},
{str8_lit_comp("memory"), str8_lit_comp("memories"), str8_lit_comp("Memory"), str8_lit_comp("Memories"), RD_IconKind_Grid},
{str8_lit_comp("hit_count"), str8_lit_comp("hit_counts"), str8_lit_comp("Hit Count"), str8_lit_comp("Hit Counts"), RD_IconKind_Null},
{str8_lit_comp("disabled"), str8_lit_comp(""), str8_lit_comp("Disabled"), str8_lit_comp("Disabled"), RD_IconKind_Null},
{str8_lit_comp("debug_subprocesses"), str8_lit_comp(""), str8_lit_comp("Debug Subprocesses"), str8_lit_comp(""), RD_IconKind_Null},
{str8_lit_comp("environment"), str8_lit_comp("environments"), str8_lit_comp("Environment"), str8_lit_comp("Environments"), RD_IconKind_Null},
};
RD_NameSchemaInfo rd_name_schema_info_table[10] =
+1 -1
View File
@@ -570,7 +570,7 @@ C_LINKAGE_BEGIN
extern String8 rd_cfg_src_string_table[4];
extern RD_CmdKind rd_cfg_src_load_cmd_kind_table[4];
extern RD_CmdKind rd_cfg_src_write_cmd_kind_table[4];
extern RD_VocabularyInfo rd_vocabulary_info_table[60];
extern RD_VocabularyInfo rd_vocabulary_info_table[64];
extern RD_NameSchemaInfo rd_name_schema_info_table[10];
extern Rng1U64 rd_reg_slot_range_table[38];
extern RD_StringBindingPair rd_default_binding_table[111];
+4
View File
@@ -111,6 +111,10 @@ RD_VocabularyMap:
{register _ "Register" _ Null }
{local _ "Local" _ Null }
{memory memories "Memory" "Memories" Grid }
{hit_count hit_counts "Hit Count" "Hit Counts" Null }
{disabled "" "Disabled" "Disabled" Null }
{debug_subprocesses "" "Debug Subprocesses" "" Null }
{environment _ "Environment" _ Null }
}
@struct RD_VocabularyInfo:
+17 -2
View File
@@ -1214,7 +1214,22 @@ rd_info_from_watch_row_cell(Arena *arena, EV_Row *row, EV_StringFlags string_fla
}break;
case E_ExprKind_MemberAccess:
{
result.string = push_str8f(arena, ".%S", e_string_from_expr(arena, notable_expr->last));
E_Eval row_eval = e_eval_from_expr(arena, row->expr);
String8 member_name = e_string_from_expr(arena, notable_expr->last);
B32 is_non_code = 0;
String8 string = push_str8f(arena, ".%S", member_name);
if(row_eval.space.kind == RD_EvalSpaceKind_MetaCfg ||
row_eval.space.kind == RD_EvalSpaceKind_MetaCtrlEntity)
{
String8 fancy_name = rd_display_from_code_name(member_name);
if(fancy_name.size != 0)
{
string = fancy_name;
is_non_code = 1;
}
}
result.is_non_code = is_non_code;
result.string = string;
}break;
}
}
@@ -2770,7 +2785,7 @@ RD_VIEW_UI_FUNCTION_DEF(watch)
}
// rjf: build cell line edit
else
else RD_Font(cell_info.is_non_code ? RD_FontSlot_Main : RD_FontSlot_Code)
{
RD_LineEditParams line_edit_params = {0};
{
+1
View File
@@ -93,6 +93,7 @@ struct RD_WatchRowCellInfo
E_Eval eval;
String8 string;
DR_FancyStringList fancy_strings;
B32 is_non_code;
B32 is_button;
B32 can_edit;
B32 is_errored;