mirror of
https://github.com/Ed94/raddebugger.git
synced 2026-07-09 02:51:38 -07:00
eliminate old autocompletion code
This commit is contained in:
+5
-893
@@ -9663,713 +9663,6 @@ rd_set_hover_eval(Vec2F32 pos, String8 string)
|
||||
////////////////////////////////
|
||||
//~ rjf: Autocompletion Lister
|
||||
|
||||
internal void
|
||||
rd_set_autocomp_regs_(RD_Regs *regs)
|
||||
{
|
||||
RD_Cfg *window_cfg = rd_cfg_from_id(rd_regs()->window);
|
||||
RD_WindowState *ws = rd_window_state_from_cfg(window_cfg);
|
||||
if(ws->autocomp_last_frame_index < rd_state->frame_index)
|
||||
{
|
||||
ws->autocomp_last_frame_index = rd_state->frame_index;
|
||||
arena_clear(ws->autocomp_arena);
|
||||
ws->autocomp_regs = rd_regs_copy(ws->autocomp_arena, regs);
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Lister Functions
|
||||
|
||||
internal void
|
||||
rd_lister_item_chunk_list_push(Arena *arena, RD_ListerItemChunkList *list, U64 cap, RD_ListerItem *item)
|
||||
{
|
||||
RD_ListerItemChunkNode *n = list->last;
|
||||
if(n == 0 || n->count >= n->cap)
|
||||
{
|
||||
n = push_array(arena, RD_ListerItemChunkNode, 1);
|
||||
SLLQueuePush(list->first, list->last, n);
|
||||
n->cap = cap;
|
||||
n->v = push_array_no_zero(arena, RD_ListerItem, n->cap);
|
||||
list->chunk_count += 1;
|
||||
}
|
||||
MemoryCopyStruct(&n->v[n->count], item);
|
||||
n->count += 1;
|
||||
list->total_count += 1;
|
||||
}
|
||||
|
||||
internal RD_ListerItemArray
|
||||
rd_lister_item_array_from_chunk_list(Arena *arena, RD_ListerItemChunkList *list)
|
||||
{
|
||||
RD_ListerItemArray array = {0};
|
||||
array.count = list->total_count;
|
||||
array.v = push_array_no_zero(arena, RD_ListerItem, array.count);
|
||||
U64 idx = 0;
|
||||
for(RD_ListerItemChunkNode *n = list->first; n != 0; n = n->next)
|
||||
{
|
||||
MemoryCopy(array.v+idx, n->v, sizeof(RD_ListerItem)*n->count);
|
||||
idx += n->count;
|
||||
}
|
||||
return array;
|
||||
}
|
||||
|
||||
internal int
|
||||
rd_lister_item_qsort_compare(RD_ListerItem *a, RD_ListerItem *b)
|
||||
{
|
||||
int result = 0;
|
||||
if(a->group < b->group)
|
||||
{
|
||||
result = -1;
|
||||
}
|
||||
else if(a->group > b->group)
|
||||
{
|
||||
result = +1;
|
||||
}
|
||||
else if(a->display_name__matches.count > b->display_name__matches.count)
|
||||
{
|
||||
result = -1;
|
||||
}
|
||||
else if(a->display_name__matches.count < b->display_name__matches.count)
|
||||
{
|
||||
result = +1;
|
||||
}
|
||||
else if(a->description__matches.count > b->description__matches.count)
|
||||
{
|
||||
result = -1;
|
||||
}
|
||||
else if(a->description__matches.count < b->description__matches.count)
|
||||
{
|
||||
result = +1;
|
||||
}
|
||||
else if(a->kind_name__matches.count > b->kind_name__matches.count)
|
||||
{
|
||||
result = -1;
|
||||
}
|
||||
else if(a->kind_name__matches.count < b->kind_name__matches.count)
|
||||
{
|
||||
result = +1;
|
||||
}
|
||||
else if(a->string.size < b->string.size)
|
||||
{
|
||||
result = -1;
|
||||
}
|
||||
else if(a->string.size > b->string.size)
|
||||
{
|
||||
result = +1;
|
||||
}
|
||||
else
|
||||
{
|
||||
result = strncmp((char *)a->string.str, (char *)b->string.str, Min(a->string.size, b->string.size));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
internal void
|
||||
rd_lister_item_array_sort__in_place(RD_ListerItemArray *array)
|
||||
{
|
||||
quick_sort(array->v, array->count, sizeof(array->v[0]), rd_lister_item_qsort_compare);
|
||||
}
|
||||
|
||||
internal RD_ListerItemArray
|
||||
rd_lister_item_array_from_regs_needle_cursor_off(Arena *arena, RD_Regs *regs, String8 needle, U64 cursor_off)
|
||||
{
|
||||
Temp scratch = scratch_begin(&arena, 1);
|
||||
DI_Scope *di_scope = di_scope_open();
|
||||
String8 needle_path = rd_lister_query_path_from_input_string_off(needle, cursor_off);
|
||||
RD_ListerItemChunkList item_list = {0};
|
||||
DI_KeyList dbgi_keys_list = d_push_active_dbgi_key_list(scratch.arena);
|
||||
DI_KeyArray dbgi_keys = di_key_array_from_list(scratch.arena, &dbgi_keys_list);
|
||||
|
||||
#if 0 // TODO(rjf): @cfg (lister)
|
||||
|
||||
//////////////////////////
|
||||
//- rjf: determine all ctx filters
|
||||
//
|
||||
String8List ctx_filter_strings = {0};
|
||||
{
|
||||
switch(regs->reg_slot)
|
||||
{
|
||||
default:{}break;
|
||||
case RD_RegSlot_Cursor:
|
||||
{
|
||||
if(!txt_pt_match(regs->cursor, regs->mark))
|
||||
{
|
||||
str8_list_pushf(scratch.arena, &ctx_filter_strings, "$text_rng,");
|
||||
}
|
||||
else
|
||||
{
|
||||
str8_list_pushf(scratch.arena, &ctx_filter_strings, "$text_pt,");
|
||||
}
|
||||
}break;
|
||||
case RD_RegSlot_Cfg:
|
||||
{
|
||||
RD_Cfg *cfg = rd_cfg_from_id(regs->cfg);
|
||||
str8_list_pushf(scratch.arena, &ctx_filter_strings, "$%S,", cfg->string);
|
||||
}break;
|
||||
case RD_RegSlot_View:
|
||||
{
|
||||
RD_Cfg *view = rd_cfg_from_id(regs->view);
|
||||
str8_list_pushf(scratch.arena, &ctx_filter_strings, "$tab,");
|
||||
str8_list_pushf(scratch.arena, &ctx_filter_strings, "$%S,", view->string);
|
||||
String8 view_expr = rd_expr_from_cfg(view);
|
||||
String8 view_file_path = rd_file_path_from_eval_string(scratch.arena, view_expr);
|
||||
if(view_file_path.size != 0)
|
||||
{
|
||||
str8_list_pushf(scratch.arena, &ctx_filter_strings, "$file,");
|
||||
}
|
||||
} // fallthrough;
|
||||
case RD_RegSlot_Panel:
|
||||
{
|
||||
str8_list_pushf(scratch.arena, &ctx_filter_strings, "$panel,");
|
||||
}break;
|
||||
}
|
||||
}
|
||||
|
||||
//////////////////////////
|
||||
//- rjf: grab rdis
|
||||
//
|
||||
U64 rdis_count = dbgi_keys.count;
|
||||
RDI_Parsed **rdis = push_array(scratch.arena, RDI_Parsed *, rdis_count);
|
||||
{
|
||||
for(U64 idx = 0; idx < rdis_count; idx += 1)
|
||||
{
|
||||
RDI_Parsed *rdi = di_rdi_from_key(di_scope, &dbgi_keys.v[idx], 0);
|
||||
RDI_TopLevelInfo *tli = rdi_element_from_name_idx(rdi, TopLevelInfo, 0);
|
||||
rdis[idx] = rdi;
|
||||
}
|
||||
}
|
||||
|
||||
//- rjf: gather locals
|
||||
if(flags & RD_ListerFlag_Locals)
|
||||
{
|
||||
CTRL_Entity *thread = ctrl_entity_from_handle(d_state->ctrl_entity_store, rd_regs()->thread);
|
||||
U64 thread_rip_vaddr = d_query_cached_rip_from_thread_unwind(thread, rd_regs()->unwind_count);
|
||||
CTRL_Entity *process = ctrl_entity_ancestor_from_kind(thread, CTRL_EntityKind_Process);
|
||||
CTRL_Entity *module = ctrl_module_from_process_vaddr(process, thread_rip_vaddr);
|
||||
U64 thread_rip_voff = ctrl_voff_from_vaddr(module, thread_rip_vaddr);
|
||||
DI_Key dbgi_key = ctrl_dbgi_key_from_module(module);
|
||||
E_String2NumMap *locals_map = d_query_cached_locals_map_from_dbgi_key_voff(&dbgi_key, thread_rip_voff);
|
||||
E_String2NumMap *member_map = d_query_cached_member_map_from_dbgi_key_voff(&dbgi_key, thread_rip_voff);
|
||||
for(E_String2NumMapNode *n = locals_map->first; n != 0; n = n->order_next)
|
||||
{
|
||||
FuzzyMatchRangeList display_name__matches = fuzzy_match_find(arena, needle, n->string);
|
||||
if(display_name__matches.count == display_name__matches.needle_part_count)
|
||||
{
|
||||
rd_lister_item_chunk_list_push_new(scratch.arena, &item_list, 256,
|
||||
.string = n->string,
|
||||
.kind_name = str8_lit("Local"),
|
||||
.display_name = n->string,
|
||||
.display_name__matches = display_name__matches);
|
||||
}
|
||||
}
|
||||
for(E_String2NumMapNode *n = member_map->first; n != 0; n = n->order_next)
|
||||
{
|
||||
FuzzyMatchRangeList display_name__matches = fuzzy_match_find(arena, needle, n->string);
|
||||
if(display_name__matches.count == display_name__matches.needle_part_count)
|
||||
{
|
||||
rd_lister_item_chunk_list_push_new(scratch.arena, &item_list, 256,
|
||||
.string = n->string,
|
||||
.kind_name = str8_lit("Local (Member)"),
|
||||
.display_name = n->string,
|
||||
.display_name__matches = display_name__matches);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//- rjf: gather registers
|
||||
if(flags & RD_ListerFlag_Registers)
|
||||
{
|
||||
CTRL_Entity *thread = ctrl_entity_from_handle(d_state->ctrl_entity_store, rd_regs()->thread);
|
||||
Arch arch = thread->arch;
|
||||
U64 reg_names_count = regs_reg_code_count_from_arch(arch);
|
||||
U64 alias_names_count = regs_alias_code_count_from_arch(arch);
|
||||
String8 *reg_names = regs_reg_code_string_table_from_arch(arch);
|
||||
String8 *alias_names = regs_alias_code_string_table_from_arch(arch);
|
||||
for(U64 idx = 0; idx < reg_names_count; idx += 1)
|
||||
{
|
||||
if(reg_names[idx].size != 0)
|
||||
{
|
||||
String8 display_name = reg_names[idx];
|
||||
FuzzyMatchRangeList display_name__matches = fuzzy_match_find(arena, needle, display_name);
|
||||
if(display_name__matches.count == display_name__matches.needle_part_count)
|
||||
{
|
||||
rd_lister_item_chunk_list_push_new(scratch.arena, &item_list, 256,
|
||||
.string = display_name,
|
||||
.kind_name = str8_lit("Register"),
|
||||
.display_name = display_name,
|
||||
.display_name__matches = display_name__matches);
|
||||
}
|
||||
}
|
||||
}
|
||||
for(U64 idx = 0; idx < alias_names_count; idx += 1)
|
||||
{
|
||||
if(alias_names[idx].size != 0)
|
||||
{
|
||||
String8 display_name = alias_names[idx];
|
||||
FuzzyMatchRangeList display_name__matches = fuzzy_match_find(arena, needle, display_name);
|
||||
if(display_name__matches.count == display_name__matches.needle_part_count)
|
||||
{
|
||||
rd_lister_item_chunk_list_push_new(scratch.arena, &item_list, 256,
|
||||
.string = display_name,
|
||||
.kind_name = str8_lit("Reg. Alias"),
|
||||
.display_name = display_name,
|
||||
.display_name__matches = display_name__matches);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//- rjf: gather view rules
|
||||
if(flags & RD_ListerFlag_ViewRules)
|
||||
{
|
||||
for(U64 slot_idx = 0; slot_idx < d_state->view_rule_spec_table_size; slot_idx += 1)
|
||||
{
|
||||
for(D_ViewRuleSpec *spec = d_state->view_rule_spec_table[slot_idx]; spec != 0 && spec != &d_nil_core_view_rule_spec; spec = spec->hash_next)
|
||||
{
|
||||
String8 display_name = spec->info.string;
|
||||
FuzzyMatchRangeList display_name__matches = fuzzy_match_find(arena, needle, display_name);
|
||||
String8 description = spec->info.description;
|
||||
FuzzyMatchRangeList description__matches = fuzzy_match_find(arena, needle, description);
|
||||
if(display_name__matches.count == display_name__matches.needle_part_count ||
|
||||
description__matches.count == description__matches.needle_part_count)
|
||||
{
|
||||
rd_lister_item_chunk_list_push_new(scratch.arena, &item_list, 256,
|
||||
.string = display_name,
|
||||
.kind_name = str8_lit("View Rule"),
|
||||
.display_name = display_name,
|
||||
.display_name__matches = display_name__matches,
|
||||
.description = description,
|
||||
.description__matches = description__matches);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//- rjf: gather members
|
||||
if(flags & RD_ListerFlag_Members)
|
||||
{
|
||||
// TODO(rjf)
|
||||
}
|
||||
|
||||
//- rjf: gather globals
|
||||
if(flags & RD_ListerFlag_Globals && needle.size != 0)
|
||||
{
|
||||
U128 search_key = {d_hash_from_string(str8_lit("autocomp_globals_search_key")), d_hash_from_string(str8_lit("autocomp_globals_search_key"))};
|
||||
DI_SearchParams search_params =
|
||||
{
|
||||
RDI_SectionKind_GlobalVariables,
|
||||
dbgi_keys,
|
||||
};
|
||||
B32 is_stale = 0;
|
||||
DI_SearchItemArray items = di_search_items_from_key_params_query(di_scope, search_key, &search_params, needle, 0, &is_stale);
|
||||
for(U64 idx = 0; idx < 20 && idx < items.count; idx += 1)
|
||||
{
|
||||
// rjf: skip bad elements
|
||||
if(items.v[idx].dbgi_idx >= rdis_count)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// rjf: unpack info
|
||||
RDI_Parsed *rdi = rdis[items.v[idx].dbgi_idx];
|
||||
String8 display_name = di_search_item_string_from_rdi_target_element_idx(rdi, search_params.target, items.v[idx].idx);
|
||||
FuzzyMatchRangeList display_name__matches = items.v[idx].match_ranges;
|
||||
|
||||
// rjf: push item
|
||||
rd_lister_item_chunk_list_push_new(scratch.arena, &item_list, 256,
|
||||
.string = display_name,
|
||||
.kind_name = str8_lit("Global"),
|
||||
.display_name = display_name,
|
||||
.display_name__matches = display_name__matches,
|
||||
.group = 1);
|
||||
}
|
||||
}
|
||||
|
||||
//- rjf: gather thread locals
|
||||
if(flags & RD_ListerFlag_ThreadLocals && needle.size != 0)
|
||||
{
|
||||
U128 search_key = {d_hash_from_string(str8_lit("autocomp_tvars_dis_key")), d_hash_from_string(str8_lit("autocomp_tvars_dis_key"))};
|
||||
DI_SearchParams search_params =
|
||||
{
|
||||
RDI_SectionKind_ThreadVariables,
|
||||
dbgi_keys,
|
||||
};
|
||||
B32 is_stale = 0;
|
||||
DI_SearchItemArray items = di_search_items_from_key_params_query(di_scope, search_key, &search_params, needle, 0, &is_stale);
|
||||
for(U64 idx = 0; idx < 20 && idx < items.count; idx += 1)
|
||||
{
|
||||
// rjf: skip bad elements
|
||||
if(items.v[idx].dbgi_idx >= rdis_count)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// rjf: unpack info
|
||||
RDI_Parsed *rdi = rdis[items.v[idx].dbgi_idx];
|
||||
String8 display_name = di_search_item_string_from_rdi_target_element_idx(rdi, search_params.target, items.v[idx].idx);
|
||||
FuzzyMatchRangeList display_name__matches = items.v[idx].match_ranges;
|
||||
|
||||
// rjf: push item
|
||||
rd_lister_item_chunk_list_push_new(scratch.arena, &item_list, 256,
|
||||
.string = display_name,
|
||||
.kind_name = str8_lit("Thread Local"),
|
||||
.display_name = display_name,
|
||||
.display_name__matches = display_name__matches,
|
||||
.group = 1);
|
||||
}
|
||||
}
|
||||
|
||||
//- rjf: gather procedures
|
||||
if(flags & RD_ListerFlag_Procedures && needle.size != 0)
|
||||
{
|
||||
U128 search_key = {d_hash_from_string(str8_lit("autocomp_procedures_search_key")), d_hash_from_string(str8_lit("autocomp_procedures_search_key"))};
|
||||
DI_SearchParams search_params =
|
||||
{
|
||||
RDI_SectionKind_Procedures,
|
||||
dbgi_keys,
|
||||
};
|
||||
B32 is_stale = 0;
|
||||
DI_SearchItemArray items = di_search_items_from_key_params_query(di_scope, search_key, &search_params, needle, 0, &is_stale);
|
||||
for(U64 idx = 0; idx < 20 && idx < items.count; idx += 1)
|
||||
{
|
||||
// rjf: skip bad elements
|
||||
if(items.v[idx].dbgi_idx >= rdis_count)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// rjf: unpack info
|
||||
RDI_Parsed *rdi = rdis[items.v[idx].dbgi_idx];
|
||||
String8 display_name = di_search_item_string_from_rdi_target_element_idx(rdi, search_params.target, items.v[idx].idx);
|
||||
FuzzyMatchRangeList display_name__matches = items.v[idx].match_ranges;
|
||||
|
||||
// rjf: push item
|
||||
rd_lister_item_chunk_list_push_new(scratch.arena, &item_list, 256,
|
||||
.string = display_name,
|
||||
.kind_name = str8_lit("Procedure"),
|
||||
.display_name = display_name,
|
||||
.display_name__matches = display_name__matches,
|
||||
.group = 1);
|
||||
}
|
||||
}
|
||||
|
||||
//- rjf: gather types
|
||||
if(flags & RD_ListerFlag_Types && needle.size != 0)
|
||||
{
|
||||
U128 search_key = {d_hash_from_string(str8_lit("autocomp_types_search_key")), d_hash_from_string(str8_lit("autocomp_types_search_key"))};
|
||||
DI_SearchParams search_params =
|
||||
{
|
||||
RDI_SectionKind_UDTs,
|
||||
dbgi_keys,
|
||||
};
|
||||
B32 is_stale = 0;
|
||||
DI_SearchItemArray items = di_search_items_from_key_params_query(di_scope, search_key, &search_params, needle, 0, &is_stale);
|
||||
for(U64 idx = 0; idx < 20 && idx < items.count; idx += 1)
|
||||
{
|
||||
// rjf: skip bad elements
|
||||
if(items.v[idx].dbgi_idx >= rdis_count)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// rjf: unpack info
|
||||
RDI_Parsed *rdi = rdis[items.v[idx].dbgi_idx];
|
||||
String8 display_name = di_search_item_string_from_rdi_target_element_idx(rdi, search_params.target, items.v[idx].idx);
|
||||
FuzzyMatchRangeList display_name__matches = items.v[idx].match_ranges;
|
||||
|
||||
// rjf: push item
|
||||
rd_lister_item_chunk_list_push_new(scratch.arena, &item_list, 256,
|
||||
.string = display_name,
|
||||
.kind_name = str8_lit("Type"),
|
||||
.display_name = display_name,
|
||||
.display_name__matches = display_name__matches,
|
||||
.group = 1);
|
||||
}
|
||||
}
|
||||
|
||||
//- rjf: gather languages
|
||||
if(flags & RD_ListerFlag_Languages)
|
||||
{
|
||||
for EachNonZeroEnumVal(TXT_LangKind, lang)
|
||||
{
|
||||
String8 display_name = txt_extension_from_lang_kind(lang);
|
||||
if(display_name.size != 0)
|
||||
{
|
||||
FuzzyMatchRangeList display_name__matches = fuzzy_match_find(arena, needle, display_name);
|
||||
if(display_name__matches.count == display_name__matches.needle_part_count)
|
||||
{
|
||||
rd_lister_item_chunk_list_push_new(scratch.arena, &item_list, 256,
|
||||
.string = display_name,
|
||||
.kind_name = str8_lit("Language"),
|
||||
.display_name = display_name,
|
||||
.display_name__matches = display_name__matches);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//- rjf: gather architectures
|
||||
if(flags & RD_ListerFlag_Architectures)
|
||||
{
|
||||
for EachNonZeroEnumVal(Arch, arch)
|
||||
{
|
||||
String8 display_name = string_from_arch(arch);
|
||||
FuzzyMatchRangeList display_name__matches = fuzzy_match_find(arena, needle, display_name);
|
||||
if(display_name__matches.count == display_name__matches.needle_part_count)
|
||||
{
|
||||
rd_lister_item_chunk_list_push_new(scratch.arena, &item_list, 256,
|
||||
.string = display_name,
|
||||
.kind_name = str8_lit("Architecture"),
|
||||
.display_name = display_name,
|
||||
.display_name__matches = display_name__matches);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//- rjf: gather tex2dformats
|
||||
if(flags & RD_ListerFlag_Tex2DFormats)
|
||||
{
|
||||
for EachEnumVal(R_Tex2DFormat, fmt)
|
||||
{
|
||||
String8 display_name = lower_from_str8(scratch.arena, r_tex2d_format_display_string_table[fmt]);
|
||||
FuzzyMatchRangeList display_name__matches = fuzzy_match_find(arena, needle, display_name);
|
||||
if(display_name__matches.count == display_name__matches.needle_part_count)
|
||||
{
|
||||
rd_lister_item_chunk_list_push_new(scratch.arena, &item_list, 256,
|
||||
.string = display_name,
|
||||
.kind_name = str8_lit("2D Texture Format"),
|
||||
.display_name = display_name,
|
||||
.display_name__matches = display_name__matches);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//- rjf: gather view rule params
|
||||
#if 0 // TODO(rjf): @cfg (lister)
|
||||
if(flags & RD_ListerFlag_ViewRuleParams)
|
||||
{
|
||||
for(String8Node *n = strings.first; n != 0; n = n->next)
|
||||
{
|
||||
String8 display_name = n->string;
|
||||
FuzzyMatchRangeList display_name__matches = fuzzy_match_find(arena, needle, display_name);
|
||||
if(display_name__matches.count == display_name__matches.needle_part_count)
|
||||
{
|
||||
rd_lister_item_chunk_list_push_new(scratch.arena, &item_list, 256,
|
||||
.string = display_name,
|
||||
.kind_name = str8_lit("View Rule Parameter"),
|
||||
.display_name = display_name,
|
||||
.display_name__matches = display_name__matches);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
//- rjf: gather files
|
||||
if(flags & RD_ListerFlag_Files)
|
||||
{
|
||||
// rjf: find containing directory in needle_path
|
||||
String8 dir_str_in_input = {0};
|
||||
for(U64 i = 0; i < needle_path.size; i += 1)
|
||||
{
|
||||
String8 substr1 = str8_substr(needle_path, r1u64(i, i+1));
|
||||
String8 substr2 = str8_substr(needle_path, r1u64(i, i+2));
|
||||
String8 substr3 = str8_substr(needle_path, r1u64(i, i+3));
|
||||
if(str8_match(substr1, str8_lit("/"), StringMatchFlag_SlashInsensitive))
|
||||
{
|
||||
dir_str_in_input = str8_substr(needle_path, r1u64(i, needle_path.size));
|
||||
}
|
||||
else if(i != 0 && str8_match(substr2, str8_lit(":/"), StringMatchFlag_SlashInsensitive))
|
||||
{
|
||||
dir_str_in_input = str8_substr(needle_path, r1u64(i-1, needle_path.size));
|
||||
}
|
||||
else if(str8_match(substr2, str8_lit("./"), StringMatchFlag_SlashInsensitive))
|
||||
{
|
||||
dir_str_in_input = str8_substr(needle_path, r1u64(i, needle_path.size));
|
||||
}
|
||||
else if(str8_match(substr3, str8_lit("../"), StringMatchFlag_SlashInsensitive))
|
||||
{
|
||||
dir_str_in_input = str8_substr(needle_path, r1u64(i, needle_path.size));
|
||||
}
|
||||
if(dir_str_in_input.size != 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// rjf: use needle_path string to form various parts of search space
|
||||
String8 prefix = {0};
|
||||
String8 path = {0};
|
||||
String8 search = {0};
|
||||
if(dir_str_in_input.size != 0)
|
||||
{
|
||||
String8 dir = dir_str_in_input;
|
||||
U64 one_past_last_slash = dir.size;
|
||||
for(U64 i = 0; i < dir_str_in_input.size; i += 1)
|
||||
{
|
||||
if(dir_str_in_input.str[i] == '/' || dir_str_in_input.str[i] == '\\')
|
||||
{
|
||||
one_past_last_slash = i+1;
|
||||
}
|
||||
}
|
||||
dir.size = one_past_last_slash;
|
||||
path = dir;
|
||||
search = str8_substr(dir_str_in_input, r1u64(one_past_last_slash, dir_str_in_input.size));
|
||||
prefix = str8_substr(needle_path, r1u64(0, path.str - needle_path.str));
|
||||
}
|
||||
|
||||
// rjf: get current files, filtered
|
||||
if(dir_str_in_input.size != 0)
|
||||
{
|
||||
B32 allow_dirs = 1;
|
||||
OS_FileIter *it = os_file_iter_begin(scratch.arena, path, 0);
|
||||
for(OS_FileInfo info = {0}; os_file_iter_next(scratch.arena, it, &info);)
|
||||
{
|
||||
FuzzyMatchRangeList match_ranges = fuzzy_match_find(arena, search, info.name);
|
||||
B32 fits_search = (match_ranges.count == match_ranges.needle_part_count);
|
||||
B32 fits_dir_only = (allow_dirs || !(info.props.flags & FilePropertyFlag_IsFolder));
|
||||
if(fits_search && fits_dir_only)
|
||||
{
|
||||
rd_lister_item_chunk_list_push_new(scratch.arena, &item_list, 256,
|
||||
.string = info.name,
|
||||
.kind_name = info.props.flags & FilePropertyFlag_IsFolder ? str8_lit("Folder") : str8_lit("File"),
|
||||
.display_name = info.name,
|
||||
.icon_kind = info.props.flags & FilePropertyFlag_IsFolder ? RD_IconKind_FolderClosedFilled : RD_IconKind_FileOutline,
|
||||
.display_name__matches = match_ranges,
|
||||
.flags = RD_ListerItemFlag_IsNonCode);
|
||||
}
|
||||
}
|
||||
os_file_iter_end(it);
|
||||
}
|
||||
}
|
||||
|
||||
//- rjf: gather commands
|
||||
if(flags & RD_ListerFlag_Commands)
|
||||
{
|
||||
for EachNonZeroEnumVal(RD_CmdKind, k)
|
||||
{
|
||||
RD_CmdKindInfo *info = &rd_cmd_kind_info_table[k];
|
||||
B32 included_by_filter_string = 0;
|
||||
for(String8Node *n = ctx_filter_strings.first; n != 0; n = n->next)
|
||||
{
|
||||
B32 n_match = (str8_find_needle(info->ctx_filter, 0, n->string, 0) < info->ctx_filter.size);
|
||||
if(n_match)
|
||||
{
|
||||
included_by_filter_string = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(ctx_filter_strings.node_count == 0 || included_by_filter_string)
|
||||
{
|
||||
String8 cmd_display_name = info->display_name;
|
||||
String8 cmd_desc = info->description;
|
||||
String8 cmd_tags = info->search_tags;
|
||||
FuzzyMatchRangeList name_matches = fuzzy_match_find(arena, needle, cmd_display_name);
|
||||
FuzzyMatchRangeList desc_matches = fuzzy_match_find(arena, needle, cmd_desc);
|
||||
FuzzyMatchRangeList tags_matches = fuzzy_match_find(arena, needle, cmd_tags);
|
||||
if(name_matches.count == name_matches.needle_part_count ||
|
||||
desc_matches.count == name_matches.needle_part_count ||
|
||||
tags_matches.count > 0 ||
|
||||
name_matches.needle_part_count == 0)
|
||||
{
|
||||
rd_lister_item_chunk_list_push_new(scratch.arena, &item_list, 256,
|
||||
.icon_kind = info->icon_kind,
|
||||
.string = info->string,
|
||||
.kind_name = str8_lit("Command"),
|
||||
.display_name = cmd_display_name,
|
||||
.display_name__matches = name_matches,
|
||||
.description = cmd_desc,
|
||||
.description__matches = desc_matches,
|
||||
.flags = RD_ListerItemFlag_IsNonCode|RD_ListerItemFlag_Bindings);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//- rjf: gather settings
|
||||
if(flags & RD_ListerFlag_Settings)
|
||||
{
|
||||
#if 0 // TODO(rjf): @cfg (lister)
|
||||
String8List schema_strings = {0};
|
||||
|
||||
// rjf: push schema for view
|
||||
{
|
||||
RD_Cfg *view = rd_cfg_from_id(regs->view);
|
||||
String8 view_name = view->string;
|
||||
RD_ViewRuleInfo *view_rule_info = rd_view_rule_info_from_string(view_name);
|
||||
str8_list_push(scratch.arena, &schema_strings, view_rule_info->params_schema);
|
||||
}
|
||||
|
||||
// rjf: for each schema, gather parameters
|
||||
for(String8Node *n = schema_strings.first; n != 0; n = n->next)
|
||||
{
|
||||
MD_Node *schema = md_tree_from_string(scratch.arena, n->string)->first;
|
||||
for MD_EachNode(param, schema->first)
|
||||
{
|
||||
RD_VocabInfo *param_vocab_info = rd_vocab_info_from_code_name(param->string);
|
||||
String8 name = param_vocab_info->display_name;
|
||||
RD_IconKind icon_kind = param_vocab_info->icon_kind;
|
||||
FuzzyMatchRangeList name_matches = fuzzy_match_find(arena, needle, name);
|
||||
if(name_matches.count == name_matches.needle_part_count)
|
||||
{
|
||||
rd_lister_item_chunk_list_push_new(scratch.arena, &item_list, 256,
|
||||
.icon_kind = icon_kind,
|
||||
.string = param->string,
|
||||
.kind_name = str8_lit("Setting"),
|
||||
.display_name = name,
|
||||
.display_name__matches = name_matches,
|
||||
.flags = RD_ListerItemFlag_IsNonCode);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
//- rjf: gather system processes
|
||||
if(flags & RD_ListerFlag_SystemProcesses)
|
||||
{
|
||||
U32 this_process_pid = os_get_process_info()->pid;
|
||||
DMN_ProcessIter iter = {0};
|
||||
dmn_process_iter_begin(&iter);
|
||||
for(DMN_ProcessInfo info = {0}; dmn_process_iter_next(scratch.arena, &iter, &info);)
|
||||
{
|
||||
if(info.pid == this_process_pid)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
String8 name = push_str8f(scratch.arena, "%S (PID: %i)", info.name, info.pid);
|
||||
FuzzyMatchRangeList name_matches = fuzzy_match_find(arena, needle, name);
|
||||
if(name_matches.count == name_matches.needle_part_count)
|
||||
{
|
||||
rd_lister_item_chunk_list_push_new(scratch.arena, &item_list, 256,
|
||||
.icon_kind = RD_IconKind_Threads,
|
||||
.string = name,
|
||||
.kind_name = str8_lit("System Process"),
|
||||
.display_name = name,
|
||||
.display_name__matches = name_matches,
|
||||
.flags = RD_ListerItemFlag_IsNonCode);
|
||||
}
|
||||
}
|
||||
dmn_process_iter_end(&iter);
|
||||
}
|
||||
|
||||
//- rjf: lister item list -> sorted array
|
||||
RD_ListerItemArray item_array = rd_lister_item_array_from_chunk_list(arena, &item_list);
|
||||
rd_lister_item_array_sort__in_place(&item_array);
|
||||
#endif
|
||||
RD_ListerItemArray item_array = {0};
|
||||
di_scope_close(di_scope);
|
||||
scratch_end(scratch);
|
||||
return item_array;
|
||||
}
|
||||
|
||||
internal U64
|
||||
rd_hash_from_lister_item(RD_ListerItem *item)
|
||||
{
|
||||
U64 item_hash = 5381;
|
||||
item_hash = d_hash_from_seed_string(item_hash, item->string);
|
||||
item_hash = d_hash_from_seed_string(item_hash, item->kind_name);
|
||||
item_hash = d_hash_from_seed_string(item_hash, str8_struct(&item->group));
|
||||
return item_hash;
|
||||
}
|
||||
|
||||
internal String8
|
||||
rd_lister_query_word_from_input_string_off(String8 input, U64 cursor_off)
|
||||
{
|
||||
@@ -10419,190 +9712,17 @@ rd_lister_query_path_from_input_string_off(String8 input, U64 cursor_off)
|
||||
return path;
|
||||
}
|
||||
|
||||
#if 0 // TODO(rjf): @cfg (lister)
|
||||
|
||||
internal RD_ListerParams
|
||||
rd_view_rule_lister_params_from_input_cursor(Arena *arena, String8 string, U64 cursor_off)
|
||||
{
|
||||
RD_ListerParams params = {0};
|
||||
{
|
||||
Temp scratch = scratch_begin(&arena, 1);
|
||||
|
||||
//- rjf: do partial parse of input
|
||||
MD_TokenizeResult input_tokenize = md_tokenize_from_text(scratch.arena, string);
|
||||
|
||||
//- rjf: find descension steps to cursor
|
||||
typedef struct DescendStep DescendStep;
|
||||
struct DescendStep
|
||||
{
|
||||
DescendStep *next;
|
||||
DescendStep *prev;
|
||||
String8 string;
|
||||
};
|
||||
DescendStep *first_step = 0;
|
||||
DescendStep *last_step = 0;
|
||||
DescendStep *free_step = 0;
|
||||
S32 paren_nest = 0;
|
||||
S32 colon_nest = 0;
|
||||
String8 last_step_string = {0};
|
||||
for(U64 idx = 0; idx < input_tokenize.tokens.count; idx += 1)
|
||||
{
|
||||
MD_Token *token = &input_tokenize.tokens.v[idx];
|
||||
if(token->range.min >= cursor_off)
|
||||
{
|
||||
break;
|
||||
}
|
||||
String8 token_string = str8_substr(string, token->range);
|
||||
if(token->flags & (MD_TokenFlag_Identifier|MD_TokenFlag_StringLiteral))
|
||||
{
|
||||
last_step_string = token_string;
|
||||
}
|
||||
if(str8_match(token_string, str8_lit("("), 0) || str8_match(token_string, str8_lit("["), 0) || str8_match(token_string, str8_lit("{"), 0))
|
||||
{
|
||||
paren_nest += 1;
|
||||
}
|
||||
if(str8_match(token_string, str8_lit(")"), 0) || str8_match(token_string, str8_lit("]"), 0) || str8_match(token_string, str8_lit("}"), 0))
|
||||
{
|
||||
paren_nest -= 1;
|
||||
for(;colon_nest > paren_nest; colon_nest -= 1)
|
||||
{
|
||||
if(last_step != 0)
|
||||
{
|
||||
DescendStep *step = last_step;
|
||||
DLLRemove(first_step, last_step, step);
|
||||
SLLStackPush(free_step, step);
|
||||
}
|
||||
}
|
||||
if(paren_nest == 0 && last_step != 0)
|
||||
{
|
||||
DescendStep *step = last_step;
|
||||
DLLRemove(first_step, last_step, step);
|
||||
SLLStackPush(free_step, step);
|
||||
}
|
||||
}
|
||||
if(str8_match(token_string, str8_lit(":"), 0))
|
||||
{
|
||||
colon_nest += 1;
|
||||
if(last_step_string.size != 0)
|
||||
{
|
||||
DescendStep *step = free_step;
|
||||
if(step != 0)
|
||||
{
|
||||
SLLStackPop(free_step);
|
||||
MemoryZeroStruct(step);
|
||||
}
|
||||
else
|
||||
{
|
||||
step = push_array(scratch.arena, DescendStep, 1);
|
||||
}
|
||||
step->string = last_step_string;
|
||||
DLLPushBack(first_step, last_step, step);
|
||||
}
|
||||
}
|
||||
if(str8_match(token_string, str8_lit(";"), 0) || str8_match(token_string, str8_lit(","), 0))
|
||||
{
|
||||
for(;colon_nest > paren_nest; colon_nest -= 1)
|
||||
{
|
||||
if(last_step != 0)
|
||||
{
|
||||
DescendStep *step = last_step;
|
||||
DLLRemove(first_step, last_step, step);
|
||||
SLLStackPush(free_step, step);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//- rjf: map view rule root to spec
|
||||
D_ViewRuleSpec *spec = d_view_rule_spec_from_string(first_step ? first_step->string : str8_zero());
|
||||
|
||||
//- rjf: do parse of schema
|
||||
MD_TokenizeResult schema_tokenize = md_tokenize_from_text(scratch.arena, spec->info.schema);
|
||||
MD_ParseResult schema_parse = md_parse_from_text_tokens(scratch.arena, str8_zero(), spec->info.schema, schema_tokenize.tokens);
|
||||
MD_Node *schema_rule_root = md_child_from_string(schema_parse.root, str8_lit("x"), 0);
|
||||
|
||||
//- rjf: follow schema according to descend steps, gather flags from schema node matching cursor descension steps
|
||||
if(first_step != 0)
|
||||
{
|
||||
MD_Node *schema_node = schema_rule_root;
|
||||
for(DescendStep *step = first_step->next;;)
|
||||
{
|
||||
if(step == 0)
|
||||
{
|
||||
for MD_EachNode(child, schema_node->first)
|
||||
{
|
||||
if(0){}
|
||||
else if(str8_match(child->string, str8_lit("expr"), StringMatchFlag_CaseInsensitive)) {params.flags |= RD_ListerFlag_Locals;}
|
||||
else if(str8_match(child->string, str8_lit("member"), StringMatchFlag_CaseInsensitive)) {params.flags |= RD_ListerFlag_Members;}
|
||||
else if(str8_match(child->string, str8_lit("lang"), StringMatchFlag_CaseInsensitive)) {params.flags |= RD_ListerFlag_Languages;}
|
||||
else if(str8_match(child->string, str8_lit("arch"), StringMatchFlag_CaseInsensitive)) {params.flags |= RD_ListerFlag_Architectures;}
|
||||
else if(str8_match(child->string, str8_lit("tex2dformat"), StringMatchFlag_CaseInsensitive)) {params.flags |= RD_ListerFlag_Tex2DFormats;}
|
||||
else if(child->flags & (MD_NodeFlag_StringSingleQuote|MD_NodeFlag_StringDoubleQuote|MD_NodeFlag_StringTick))
|
||||
{
|
||||
str8_list_push(arena, ¶ms.strings, child->string);
|
||||
params.flags |= RD_ListerFlag_ViewRuleParams;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
if(step != 0)
|
||||
{
|
||||
MD_Node *next_node = md_child_from_string(schema_node, step->string, StringMatchFlag_CaseInsensitive);
|
||||
schema_node = next_node;
|
||||
step = step->next;
|
||||
}
|
||||
else
|
||||
{
|
||||
schema_node = schema_node->first;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
scratch_end(scratch);
|
||||
}
|
||||
return params;
|
||||
}
|
||||
|
||||
internal void
|
||||
rd_set_autocomp_lister_query_(RD_ListerParams *params)
|
||||
rd_set_autocomp_regs_(RD_Regs *regs)
|
||||
{
|
||||
RD_Cfg *window_cfg = rd_cfg_from_id(rd_regs()->window);
|
||||
RD_WindowState *ws = rd_window_state_from_cfg(window_cfg);
|
||||
arena_clear(ws->lister_arena);
|
||||
ws->lister_regs = rd_regs_copy(ws->lister_arena, rd_regs());
|
||||
MemoryCopyStruct(&ws->lister_params, params);
|
||||
ws->lister_params.strings = str8_list_copy(ws->lister_arena, &ws->lister_params.strings);
|
||||
if(!(params->flags & RD_ListerFlag_LineEdit))
|
||||
if(ws->autocomp_last_frame_index < rd_state->frame_index)
|
||||
{
|
||||
ws->lister_input_size = Min(params->input.size, sizeof(ws->lister_input_buffer));
|
||||
MemoryCopy(ws->lister_input_buffer, params->input.str, ws->lister_input_size);
|
||||
ws->autocomp_last_frame_index = rd_state->frame_index;
|
||||
arena_clear(ws->autocomp_arena);
|
||||
ws->autocomp_regs = rd_regs_copy(ws->autocomp_arena, regs);
|
||||
}
|
||||
ws->lister_last_frame_idx = rd_state->frame_index;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
internal void
|
||||
rd_set_autocomp_lister_query_(RD_Regs *regs)
|
||||
{
|
||||
RD_Cfg *window_cfg = rd_cfg_from_id(regs->window);
|
||||
RD_WindowState *ws = rd_window_state_from_cfg(window_cfg);
|
||||
if(ws->autocomp_lister == 0)
|
||||
{
|
||||
Arena *arena = arena_alloc();
|
||||
ws->autocomp_lister = push_array(arena, RD_Lister, 1);
|
||||
ws->autocomp_lister->arena = arena;
|
||||
}
|
||||
Arena *arena = ws->autocomp_lister->arena;
|
||||
arena_clear(arena);
|
||||
ws->autocomp_lister = push_array(arena, RD_Lister, 1);
|
||||
ws->autocomp_lister->arena = arena;
|
||||
ws->autocomp_lister->regs = rd_regs_copy(arena, regs);
|
||||
ws->autocomp_lister->input_string_size = Min(regs->string.size, sizeof(ws->autocomp_lister->input_buffer));
|
||||
MemoryCopy(ws->autocomp_lister->input_buffer, regs->string.str, ws->autocomp_lister->input_string_size);
|
||||
ws->autocomp_lister->input_cursor = regs->cursor;
|
||||
ws->autocomp_lister->input_mark = regs->mark;
|
||||
ws->autocomp_lister_last_frame_idx = rd_state->frame_index;
|
||||
}
|
||||
|
||||
////////////////////////////////
|
||||
@@ -11570,14 +10690,6 @@ rd_frame(void)
|
||||
ui_state_release(ws->ui);
|
||||
r_window_unequip(ws->os, ws->r);
|
||||
os_window_close(ws->os);
|
||||
if(ws->autocomp_lister != 0)
|
||||
{
|
||||
arena_release(ws->autocomp_lister->arena);
|
||||
}
|
||||
for(RD_Lister *lister = ws->top_query_lister; lister != 0; lister = lister->next)
|
||||
{
|
||||
arena_release(lister->arena);
|
||||
}
|
||||
arena_release(ws->drop_completion_arena);
|
||||
arena_release(ws->query_arena);
|
||||
arena_release(ws->hover_eval_arena);
|
||||
|
||||
@@ -413,72 +413,6 @@ typedef enum RD_FontSlot
|
||||
}
|
||||
RD_FontSlot;
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Lister Types
|
||||
|
||||
typedef U32 RD_ListerItemFlags;
|
||||
enum
|
||||
{
|
||||
RD_ListerItemFlag_IsNonCode = (1<<0),
|
||||
RD_ListerItemFlag_Bindings = (1<<1),
|
||||
RD_ListerItemFlag_Autocompletion = (1<<2),
|
||||
};
|
||||
|
||||
typedef struct RD_ListerItem RD_ListerItem;
|
||||
struct RD_ListerItem
|
||||
{
|
||||
RD_ListerItemFlags flags;
|
||||
RD_IconKind icon_kind;
|
||||
String8 string;
|
||||
String8 kind_name;
|
||||
String8 display_name;
|
||||
String8 description;
|
||||
String8 search_tags;
|
||||
FuzzyMatchRangeList kind_name__matches;
|
||||
FuzzyMatchRangeList display_name__matches;
|
||||
FuzzyMatchRangeList description__matches;
|
||||
U64 group;
|
||||
};
|
||||
|
||||
typedef struct RD_ListerItemChunkNode RD_ListerItemChunkNode;
|
||||
struct RD_ListerItemChunkNode
|
||||
{
|
||||
RD_ListerItemChunkNode *next;
|
||||
RD_ListerItem *v;
|
||||
U64 count;
|
||||
U64 cap;
|
||||
};
|
||||
|
||||
typedef struct RD_ListerItemChunkList RD_ListerItemChunkList;
|
||||
struct RD_ListerItemChunkList
|
||||
{
|
||||
RD_ListerItemChunkNode *first;
|
||||
RD_ListerItemChunkNode *last;
|
||||
U64 chunk_count;
|
||||
U64 total_count;
|
||||
};
|
||||
|
||||
typedef struct RD_ListerItemArray RD_ListerItemArray;
|
||||
struct RD_ListerItemArray
|
||||
{
|
||||
RD_ListerItem *v;
|
||||
U64 count;
|
||||
};
|
||||
|
||||
typedef struct RD_Lister RD_Lister;
|
||||
struct RD_Lister
|
||||
{
|
||||
RD_Lister *next;
|
||||
Arena *arena;
|
||||
RD_Regs *regs;
|
||||
UI_ScrollPt scroll_pt;
|
||||
U64 selected_item_hash;
|
||||
U8 input_buffer[1024];
|
||||
U64 input_string_size;
|
||||
TxtPt input_cursor;
|
||||
TxtPt input_mark;
|
||||
};
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Per-Window State
|
||||
|
||||
@@ -519,11 +453,6 @@ struct RD_WindowState
|
||||
B32 menu_bar_key_held;
|
||||
B32 menu_bar_focus_press_started;
|
||||
|
||||
// rjf: lister state
|
||||
RD_Lister *top_query_lister;
|
||||
RD_Lister *autocomp_lister;
|
||||
U64 autocomp_lister_last_frame_idx;
|
||||
|
||||
// rjf: drop-completion state
|
||||
Arena *drop_completion_arena;
|
||||
String8List drop_completion_paths;
|
||||
@@ -1022,29 +951,10 @@ internal void rd_set_hover_eval(Vec2F32 pos, String8 string);
|
||||
////////////////////////////////
|
||||
//~ rjf: Autocompletion Lister
|
||||
|
||||
internal void rd_set_autocomp_regs_(RD_Regs *regs);
|
||||
#define rd_set_autocomp_regs(...) rd_set_autocomp_regs_(&(RD_Regs){rd_regs_lit_init_top __VA_ARGS__})
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Lister Functions
|
||||
|
||||
internal void rd_lister_item_chunk_list_push(Arena *arena, RD_ListerItemChunkList *list, U64 cap, RD_ListerItem *item);
|
||||
#define rd_lister_item_chunk_list_push_new(arena, list, cap, ...) rd_lister_item_chunk_list_push((arena), (list), (cap), &(RD_ListerItem){.string = {0}, __VA_ARGS__})
|
||||
internal RD_ListerItemArray rd_lister_item_array_from_chunk_list(Arena *arena, RD_ListerItemChunkList *list);
|
||||
internal int rd_lister_item_qsort_compare(RD_ListerItem *a, RD_ListerItem *b);
|
||||
internal void rd_lister_item_array_sort__in_place(RD_ListerItemArray *array);
|
||||
internal RD_ListerItemArray rd_lister_item_array_from_regs_needle_cursor_off(Arena *arena, RD_Regs *regs, String8 needle, U64 cursor_off);
|
||||
internal U64 rd_hash_from_lister_item(RD_ListerItem *item);
|
||||
|
||||
internal String8 rd_lister_query_word_from_input_string_off(String8 input, U64 cursor_off);
|
||||
internal String8 rd_lister_query_path_from_input_string_off(String8 input, U64 cursor_off);
|
||||
#if 0 // TODO(rjf): @cfg (lister)
|
||||
internal RD_ListerParams rd_view_rule_lister_params_from_input_cursor(Arena *arena, String8 string, U64 cursor_off);
|
||||
internal void rd_set_autocomp_lister_query_(RD_ListerParams *params);
|
||||
#define rd_set_autocomp_lister_query(...) rd_set_autocomp_lister_query_(&(RD_ListerParams){.flags = 0, __VA_ARGS__})
|
||||
#endif
|
||||
internal void rd_set_autocomp_lister_query_(RD_Regs *regs);
|
||||
#define rd_set_autocomp_lister_query(...) rd_set_autocomp_lister_query_(&(RD_Regs){rd_regs_lit_init_top __VA_ARGS__})
|
||||
internal void rd_set_autocomp_regs_(RD_Regs *regs);
|
||||
#define rd_set_autocomp_regs(...) rd_set_autocomp_regs_(&(RD_Regs){rd_regs_lit_init_top __VA_ARGS__})
|
||||
|
||||
////////////////////////////////
|
||||
//~ rjf: Colors, Fonts, Config
|
||||
|
||||
Reference in New Issue
Block a user